aboutsummaryrefslogtreecommitdiffstats
path: root/devel/gconf2
diff options
context:
space:
mode:
authorjylefort <jylefort@FreeBSD.org>2006-05-05 19:01:31 +0800
committerjylefort <jylefort@FreeBSD.org>2006-05-05 19:01:31 +0800
commit8377b8d156570b70d7cc01bb6b1b9181e01cc2a6 (patch)
treed97d1237a536b3f4e8401381e3ac3ed356083700 /devel/gconf2
parent7070e17d9f412b4f491af5ce2faa8062fa9ee2da (diff)
downloadfreebsd-ports-gnome-8377b8d156570b70d7cc01bb6b1b9181e01cc2a6.tar.gz
freebsd-ports-gnome-8377b8d156570b70d7cc01bb6b1b9181e01cc2a6.tar.zst
freebsd-ports-gnome-8377b8d156570b70d7cc01bb6b1b9181e01cc2a6.zip
Fix the long standing bug which caused newly installed GConf
applications to not pick up their default configuration values unless gconfd-2 was manually restarted. Now: - gconftool-2 --makefile-{install|uninstall}-rule will send a SIGHUP to all the gconfd-2 processes. - upon receipt of that SIGHUP, gconfd-2 will reload the database and therefore pick up the added/removed schemas (note that the stock gconfd-2 already reloaded the database when receiving a SIGHUP, but only in the periodic cleanup which ran every 30 seconds; I've modified it to reload the database immediately so that applications can be started right after they have been installed).
Diffstat (limited to 'devel/gconf2')
-rw-r--r--devel/gconf2/Makefile1
-rw-r--r--devel/gconf2/files/patch-gconf_gconfd.c64
-rw-r--r--devel/gconf2/files/patch-gconf_gconftool.c28
3 files changed, 93 insertions, 0 deletions
diff --git a/devel/gconf2/Makefile b/devel/gconf2/Makefile
index f1c3969a5219..d83e2c0c2e63 100644
--- a/devel/gconf2/Makefile
+++ b/devel/gconf2/Makefile
@@ -8,6 +8,7 @@
PORTNAME= gconf2
PORTVERSION= 2.14.0
+PORTREVISION= 1
CATEGORIES= devel gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/GConf/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/}
diff --git a/devel/gconf2/files/patch-gconf_gconfd.c b/devel/gconf2/files/patch-gconf_gconfd.c
new file mode 100644
index 000000000000..ef551cb28e81
--- /dev/null
+++ b/devel/gconf2/files/patch-gconf_gconfd.c
@@ -0,0 +1,64 @@
+--- gconf/gconfd.c.orig Fri May 5 12:40:23 2006
++++ gconf/gconfd.c Fri May 5 12:41:43 2006
+@@ -124,12 +124,6 @@
+
+ static gboolean in_shutdown = FALSE;
+
+-/*
+- * Flag indicating we received a SIGHUP and we should reaload
+- * all sources during the next periodic_cleanup()
+- */
+-static gboolean need_db_reload = FALSE;
+-
+ /*
+ * CORBA goo
+ */
+@@ -410,6 +404,18 @@
+ }
+
+ static void
++reload_db (void)
++{
++ gconf_log (GCL_INFO, _("SIGHUP received, reloading all databases"));
++
++ logfile_save ();
++ shutdown_databases ();
++ init_databases ();
++ gconf_server_load_sources ();
++ logfile_read ();
++}
++
++static void
+ signal_handler (int signo)
+ {
+ static gint in_fatal = 0;
+@@ -482,8 +488,8 @@
+ case SIGHUP:
+ --in_fatal;
+
+- /* reload sources during next periodic_cleanup() */
+- need_db_reload = TRUE;
++ /* reload sources immediately */
++ reload_db ();
+ break;
+ #endif
+
+@@ -864,18 +870,6 @@
+ static gboolean
+ periodic_cleanup_timeout(gpointer data)
+ {
+- if (need_db_reload)
+- {
+- gconf_log (GCL_INFO, _("SIGHUP received, reloading all databases"));
+-
+- need_db_reload = FALSE;
+- logfile_save ();
+- shutdown_databases ();
+- init_databases ();
+- gconf_server_load_sources ();
+- logfile_read ();
+- }
+-
+ gconf_log (GCL_DEBUG, "Performing periodic cleanup, expiring cache cruft");
+
+ drop_old_clients ();
diff --git a/devel/gconf2/files/patch-gconf_gconftool.c b/devel/gconf2/files/patch-gconf_gconftool.c
new file mode 100644
index 000000000000..c47e5e426927
--- /dev/null
+++ b/devel/gconf2/files/patch-gconf_gconftool.c
@@ -0,0 +1,28 @@
+--- gconf/gconftool.c.orig Fri May 5 12:36:01 2006
++++ gconf/gconftool.c Fri May 5 12:39:29 2006
+@@ -3724,6 +3724,8 @@
+ static int
+ do_makefile_install(GConfEngine* conf, const gchar** args, gboolean unload)
+ {
++ int sync_result;
++
+ if (args == NULL)
+ {
+ g_printerr (_("Must specify some schema files to install\n"));
+@@ -3738,7 +3740,15 @@
+ ++args;
+ }
+
+- return do_sync (conf);
++ sync_result = do_sync (conf);
++
++ /*
++ * Send all the gconfd-2 processes a SIGHUP so that they reload the
++ * databases and pick up the added/removed schemas.
++ */
++ system("/usr/bin/killall -SIGHUP gconfd-2 >/dev/null 2>&1");
++
++ return sync_result;
+ }
+
+ typedef enum {