[gnome-color-manager] trivial: don't hardcode /usr/sbin for the gcm-install-system-wide tool



commit 4fbce8a663b9cf667f39d628835316aece219e7f
Author: Richard Hughes <richard hughsie com>
Date:   Sat Jan 2 12:23:54 2010 +0000

    trivial: don't hardcode /usr/sbin for the gcm-install-system-wide tool

 src/Makefile.am |   11 ++++++-----
 src/gcm-prefs.c |    4 +++-
 2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 441d5a6..7c8695b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -11,9 +11,10 @@ INCLUDES =						\
 	-DG_UDEV_API_IS_SUBJECT_TO_CHANGE		\
 	-DGNOME_DESKTOP_USE_UNSTABLE_API		\
 	$(GUDEV_CFLAGS)					\
-	-DBINDIR=\"$(bindir)\"			 	\
-	-DSYSCONFDIR=\""$(sysconfdir)"\" 		\
-	-DVERSION="\"$(VERSION)\"" 			\
+	-DBINDIR=\"$(bindir)\"				\
+	-DSBINDIR=\"$(sbindir)\"			\
+	-DSYSCONFDIR=\""$(sysconfdir)"\"		\
+	-DVERSION="\"$(VERSION)\""			\
 	-DLOCALEDIR=\""$(localedir)"\"			\
 	-DGCM_SYSTEM_PROFILES_DIR="\"$(GCM_SYSTEM_PROFILES_DIR)"\" \
 	-DGCM_DATA=\"$(pkgdatadir)\"
@@ -274,12 +275,12 @@ clean-local:
 CLEANFILES = $(BUILT_SOURCES)
 
 MAINTAINERCLEANFILES =					\
-	*~			      			\
+	*~						\
 	Makefile.in
 
 EXTRA_DIST =						\
 	org.gnome.ColorManager.xml
 
-BUILT_SOURCES = 					\
+BUILT_SOURCES =						\
 	org.gnome.ColorManager.h
 
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index b249c27..6d93614 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -102,7 +102,7 @@ gcm_prefs_set_default (GcmDevice *device)
 	gchar *cmdline = NULL;
 	gchar *filename = NULL;
 	gchar *id = NULL;
-	const gchar *install_cmd = "/usr/sbin/gcm-install-system-wide";
+	gchar *install_cmd = NULL;
 
 	/* get device properties */
 	g_object_get (device,
@@ -117,6 +117,7 @@ gcm_prefs_set_default (GcmDevice *device)
 	}
 
 	/* run using PolicyKit */
+	install_cmd = g_build_filename (SBINDIR, "gcm-install-system-wide", NULL);
 	cmdline = g_strdup_printf ("pkexec %s --id %s \"%s\"", install_cmd, id, filename);
 	egg_debug ("running: %s", cmdline);
 	ret = g_spawn_command_line_sync (cmdline, NULL, NULL, NULL, &error);
@@ -127,6 +128,7 @@ gcm_prefs_set_default (GcmDevice *device)
 	}
 out:
 	g_free (id);
+	g_free (install_cmd);
 	g_free (cmdline);
 	g_free (filename);
 	return ret;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]