From 6edbafdc1482b1fc880092f7d687742bdf003bf2 Mon Sep 17 00:00:00 2001 From: landry Date: Fri, 31 Oct 2008 00:03:12 +0000 Subject: [PATCH] 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) --- x11/emelfm2/Makefile | 6 ++- .../patch-src_dialogs_e2_file_info_dialog_c | 38 +++++++++++++++++++ .../patches/patch-src_utils_e2_utils_c | 13 +++++++ 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 x11/emelfm2/patches/patch-src_dialogs_e2_file_info_dialog_c create mode 100644 x11/emelfm2/patches/patch-src_utils_e2_utils_c diff --git a/x11/emelfm2/Makefile b/x11/emelfm2/Makefile index 1a157e522fd..2594da83f5d 100644 --- a/x11/emelfm2/Makefile +++ b/x11/emelfm2/Makefile @@ -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 \ diff --git a/x11/emelfm2/patches/patch-src_dialogs_e2_file_info_dialog_c b/x11/emelfm2/patches/patch-src_dialogs_e2_file_info_dialog_c new file mode 100644 index 00000000000..bec00b23cfe --- /dev/null +++ b/x11/emelfm2/patches/patch-src_dialogs_e2_file_info_dialog_c @@ -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; diff --git a/x11/emelfm2/patches/patch-src_utils_e2_utils_c b/x11/emelfm2/patches/patch-src_utils_e2_utils_c new file mode 100644 index 00000000000..21df5275deb --- /dev/null +++ b/x11/emelfm2/patches/patch-src_utils_e2_utils_c @@ -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