File gnome-packagekit-opensuse-libexec.patch of Package gnome-packagekit

commit 0bda2382b84b7de6272fef03e244e5afd94a0de7
Author: Vincent Untz <vuntz@gnome.org>
Date:   Thu Oct 7 16:50:41 2010 +0200

    Do not hardcode /usr/libexec as libexecdir
    
    Note that this makes the code for gpk_dbus_task_path_is_trusted() a bit
    more complex since we can't assume $(libexecdir) will be /usr/libexec or
    /usr/libexec/, and that will cause issues when comparing strings.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=628962

Index: gnome-packagekit-2.32.0/src/Makefile.am
===================================================================
--- gnome-packagekit-2.32.0.orig/src/Makefile.am
+++ gnome-packagekit-2.32.0/src/Makefile.am
@@ -24,6 +24,7 @@ INCLUDES =						\
 	-DPREFIX=\""$(prefix)"\" 			\
 	-DSYSCONFDIR=\""$(sysconfdir)"\" 		\
 	-DLIBDIR=\""$(libdir)"\" 			\
+	-DLIBEXECDIR=\""$(libexecdir)"\" 		\
 	-DLOCALEDIR=\""$(localedir)"\"			\
 	-DVERSION="\"$(VERSION)\"" 			\
 	-DGPK_DATA=\"$(pkgdatadir)\"			\
Index: gnome-packagekit-2.32.0/src/gpk-dbus-task.c
===================================================================
--- gnome-packagekit-2.32.0.orig/src/gpk-dbus-task.c
+++ gnome-packagekit-2.32.0/src/gpk-dbus-task.c
@@ -2956,11 +2956,20 @@ out:
 static gboolean
 gpk_dbus_task_path_is_trusted (const gchar *exec)
 {
+	gboolean res = FALSE;
+	gchar *path;
+
 	/* special case the plugin helper -- it's trusted */
-	if (g_strcmp0 (exec, "/usr/libexec/gst-install-plugins-helper") == 0 ||
-	    g_strcmp0 (exec, "/usr/libexec/pk-gstreamer-install") == 0)
-		return TRUE;
-	return FALSE;
+
+	path = g_build_filename (LIBEXECDIR, "gst-install-plugins-helper", NULL);
+	res = res || (g_strcmp0 (exec, path) == 0);
+	g_free (path);
+
+	path = g_build_filename (LIBEXECDIR, "pk-gstreamer-install", NULL);
+	res = res || (g_strcmp0 (exec, path) == 0);
+	g_free (path);
+
+	return res;
 }
 
 /**
Index: gnome-packagekit-2.32.0/src/Makefile.in
===================================================================
--- gnome-packagekit-2.32.0.orig/src/Makefile.in
+++ gnome-packagekit-2.32.0/src/Makefile.in
@@ -472,6 +472,7 @@ INCLUDES = \
 	-DPREFIX=\""$(prefix)"\" 			\
 	-DSYSCONFDIR=\""$(sysconfdir)"\" 		\
 	-DLIBDIR=\""$(libdir)"\" 			\
+	-DLIBEXECDIR=\""$(libexecdir)"\" 		\
 	-DLOCALEDIR=\""$(localedir)"\"			\
 	-DVERSION="\"$(VERSION)\"" 			\
 	-DGPK_DATA=\"$(pkgdatadir)\"			\
openSUSE Build Service is sponsored by