Fix file(1) calls, we don't have those fancy options. RUN_DEPENDS on

xdg-utils as a first option, file is only used as a fallback.
Based on a diff from giovanni (MAINTAINER)
This commit is contained in:
landry 2008-10-31 00:03:12 +00:00
parent bac6de4a16
commit 6edbafdc14
3 changed files with 55 additions and 2 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.1.1.1 2008/10/30 19:32:32 landry Exp $
# $OpenBSD: Makefile,v 1.2 2008/10/31 00:03:12 landry Exp $
COMMENT = GTK+2 file manager
DISTNAME = emelfm2-0.5.0
PKGNAME = ${DISTNAME}p0
CATEGORIES = x11
HOMEPAGE = http://emelfm2.net/
@ -22,7 +23,8 @@ MODULES = devel/gettext
LIB_DEPENDS = gdk_pixbuf-2.0,gdk-x11-2.0,gtk-x11-2.0::x11/gtk+2
RUN_DEPENDS = ::devel/desktop-file-utils
RUN_DEPENDS = ::devel/desktop-file-utils \
::devel/xdg-utils
WANTLIB = X11 Xau Xcomposite Xcursor Xdamage Xdmcp Xext Xfixes \
Xi Xinerama Xrandr Xrender atk-1.0 c cairo expat fontconfig \

View File

@ -0,0 +1,38 @@
$OpenBSD: patch-src_dialogs_e2_file_info_dialog_c,v 1.1 2008/10/31 00:03:12 landry Exp $
Our file(1) doesn't have all that fancy options.
--- src/dialogs/e2_file_info_dialog.c.orig Thu Oct 30 23:50:08 2008
+++ src/dialogs/e2_file_info_dialog.c Thu Oct 30 23:56:51 2008
@@ -66,7 +66,7 @@ static gboolean _e2_file_info_dialog_get_file_type (VP
gpointer results;
//tag E2_BADQUOTES
gchar *qp = e2_utils_quote_string (VPCSTR (localpath));
- gchar *command = e2_utils_strcat ("file -bhnprs ", qp);
+ gchar *command = e2_utils_strcat ("file -bNs ", qp);
if (!e2_fs_get_command_output (command, &results))
{
g_free (qp);
@@ -80,24 +80,6 @@ static gboolean _e2_file_info_dialog_get_file_type (VP
*readable_type = results;
*mime_type = e2_utils_get_mimetype (localpath);
-
- if (*mime_type != NULL && g_str_has_prefix (*mime_type, "text/"))
- {
- //try to get encoding as well
- command = e2_utils_strcat ("file -bhnpri ", qp);
- if (e2_fs_get_command_output (command, &results))
- {
- g_strstrip ((gchar *)results); //get rid of \n etc
- if (*(gchar *)results != '\0')
- {
- g_free (*mime_type);
- *mime_type = results;
- }
- else
- g_free (results);
- }
- g_free (command);
- }
g_free (qp);
return TRUE;

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-src_utils_e2_utils_c,v 1.1 2008/10/31 00:03:12 landry Exp $
Our file(1) doesn't have all that fancy options.
--- src/utils/e2_utils.c.orig Wed Oct 22 04:28:11 2008
+++ src/utils/e2_utils.c Thu Oct 30 23:49:56 2008
@@ -466,7 +466,7 @@ gchar *e2_utils_get_mimetype (VPATH *localpath)
{
//xdg command failed, maybe due to no xdg utilities, or unrecognised type
g_free (command);
- command = e2_utils_strcat ("file -bNprs --mime-type ", qp);
+ command = e2_utils_strcat ("file -bNs ", qp);
if (e2_fs_get_command_output (command, (gpointer *) &mime))
{
g_strstrip (mime); //strip trailing \n and any whitespace