Index: /pkg/boss/main/gconf/trunk/debian/default.path
===================================================================
--- /pkg/boss/main/gconf/trunk/debian/default.path	(revision 4980)
+++ /pkg/boss/main/gconf/trunk/debian/default.path	(revision 4981)
@@ -8,4 +8,7 @@
 # Other forced sources imagined by the local administrator
 include /etc/gconf/2/local-mandatory.path
+
+# Settings forced by Debian packages
+xml:readonly:/var/lib/gconf/debian.mandatory
 
 
Index: /pkg/boss/main/gconf/trunk/debian/control
===================================================================
--- /pkg/boss/main/gconf/trunk/debian/control	(revision 4980)
+++ /pkg/boss/main/gconf/trunk/debian/control	(revision 4981)
@@ -3,5 +3,5 @@
 Priority: optional
 Maintainer: Josselin Mouette <joss@debian.org>
-Uploaders: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>, Loic Minier <lool@dooz.org>, Sebastian DrÃ¶ge <slomo@debian.org>
+Uploaders: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>, Sebastian DrÃ¶ge <slomo@debian.org>
 Build-Depends: debhelper (>= 5),
                cdbs (>= 0.4.41),
@@ -86,4 +86,5 @@
          gconf2-common (>= ${gnome:Version}),
          gconf2-common (<< ${gnome:NextVersion})
+Breaks: libbonobo2-0 (<< 2.24)
 Description: GNOME configuration database system (shared libraries)
  GConf is a configuration database system for storing application
Index: /pkg/boss/main/gconf/trunk/debian/update-gconf-defaults
===================================================================
--- /pkg/boss/main/gconf/trunk/debian/update-gconf-defaults	(revision 4980)
+++ /pkg/boss/main/gconf/trunk/debian/update-gconf-defaults	(revision 4981)
@@ -5,14 +5,33 @@
 # Licensed under the GNU LGPL, see /usr/share/common-licenses/LGPL-2.1
 
-
-defaults_dir = '/usr/share/gconf/defaults'
-outdir = '/var/lib/gconf/debian.defaults'
 treefile = '%gconf-tree.xml'
 
 import os,tempfile,shutil,sys
+from optparse import OptionParser
 
-if os.geteuid():
-  sys.stderr.write("%s needs to be run as root.\n"%sys.argv[0])
-  sys.exit(1)
+parser = OptionParser()
+parser.add_option("--source", dest="source_dir", default="/usr/share/gconf/defaults",
+                  help="directory where to find the defaults", metavar="DIR")
+parser.add_option("--destination", dest="dest_dir", default="/var/lib/gconf/debian.defaults",
+                  help="directory where to build the GConf tree", metavar="DIR")
+parser.add_option("--mandatory", action="store_true", default=False, dest="mandatory",
+                  help="select mandatory settings directories")
+parser.add_option("--no-signal", action="store_false", default=True, dest="signal",
+                  help="do not send SIGHUP the running gconfd-2 processes")
+
+(options, args) = parser.parse_args()
+
+if options.mandatory:
+    options.source_dir="/usr/share/gconf/mandatory"
+    options.dest_dir="/var/lib/gconf/debian.mandatory"
+
+if not os.path.isdir(options.source_dir):
+    parser.error("Source directory does not exist.")
+if not os.path.isdir(options.dest_dir):
+    parser.error("Destination directory does not exist.")
+if not os.access(options.source_dir,os.R_OK|os.X_OK):
+    parser.error("Source directory is not readable.")
+if not os.access(options.dest_dir,os.W_OK|os.X_OK):
+    parser.error("Destination directory is not writable.")
 
 tmp_dir=tempfile.mkdtemp(prefix="gconf-")
@@ -104,11 +123,12 @@
 
 
-defaults_files = os.listdir(defaults_dir)
+defaults_files = os.listdir(options.source_dir)
 defaults_files.sort()
 for f in defaults_files:
-  realname=defaults_dir+'/'+f
-  if f.endswith('.dpkg-tmp'):
-    pass
-  elif f.endswith('.entries'):
+  realname=options.source_dir+'/'+f
+  for ext in ['.dpkg-tmp', '.bak', '.tmp', '~', '.sav', '.save']:
+    if f.endswith(ext):
+      continue
+  if f.endswith('.entries'):
     if gconf_val:
       write_and_apply_entries(tmp_file)
@@ -121,10 +141,10 @@
 
 try:
-  shutil.copyfile(tmp_gconf+'/'+treefile,outdir+'/'+treefile+'.tmp')
-  os.rename(outdir+'/'+treefile+'.tmp',outdir+'/'+treefile)
+  shutil.copyfile(tmp_gconf+'/'+treefile,options.dest_dir+'/'+treefile+'.tmp')
+  os.rename(options.dest_dir+'/'+treefile+'.tmp',options.dest_dir+'/'+treefile)
 except IOError:
   # No %gconf-tree.xml file was created.
   try:
-    os.remove(outdir+'/'+treefile)
+    os.remove(options.dest_dir+'/'+treefile)
   except OSError:
     # No existing file
@@ -133,3 +153,4 @@
 cleanup()
 
-os.system('kill -s HUP `pidof gconfd-2` >/dev/null 2>&1')
+if options.signal:
+    os.system('kill -s HUP `pidof gconfd-2` >/dev/null 2>&1')
Index: /pkg/boss/main/gconf/trunk/debian/gconf2.install
===================================================================
--- /pkg/boss/main/gconf/trunk/debian/gconf2.install	(revision 4980)
+++ /pkg/boss/main/gconf/trunk/debian/gconf2.install	(revision 4981)
@@ -1,4 +1,4 @@
 debian/tmp/usr/bin
 debian/gconf-schemas usr/sbin/
-debian/update-gconf-defaults usr/sbin/
+debian/update-gconf-defaults usr/bin/
 debian/tmp/usr/share/man
Index: /pkg/boss/main/gconf/trunk/debian/control.in
===================================================================
--- /pkg/boss/main/gconf/trunk/debian/control.in	(revision 4980)
+++ /pkg/boss/main/gconf/trunk/debian/control.in	(revision 4981)
@@ -86,4 +86,5 @@
          gconf2-common (>= ${gnome:Version}),
          gconf2-common (<< ${gnome:NextVersion})
+Breaks: libbonobo2-0 (<< 2.24)
 Description: GNOME configuration database system (shared libraries)
  GConf is a configuration database system for storing application
Index: /pkg/boss/main/gconf/trunk/debian/update-gconf-defaults.8
===================================================================
--- /pkg/boss/main/gconf/trunk/debian/update-gconf-defaults.8	(revision 4980)
+++ /pkg/boss/main/gconf/trunk/debian/update-gconf-defaults.8	(revision 4981)
@@ -1,3 +1,3 @@
-.TH UPDATE-GCONF-DEFAULTS 8 "8 Jan 2006"
+.TH UPDATE-GCONF-DEFAULTS 8 "2 Feb 2009"
 .\" Please adjust this date whenever revising the manpage.
 .SH NAME
@@ -5,4 +5,5 @@
 .SH SYNOPSIS
 .B update-gconf-defaults
+[options]
 .SH DESCRIPTION
 This manual page documents briefly the
@@ -43,13 +44,27 @@
 50 for CDD distributions, and 90 for site-specific packages.
 .SH OPTIONS
-There are no options for this program.
+.TP
+.B \-\-source\fR \fIsource_dir
+Specify an alternate source directory where to find the defaults.
+.TP
+.B \-\-destination\fR \fIdestination_dir
+Specify an alternate destination directory where to build the resulting GConf tree.
+.TP
+.B \-\-mandatory
+Sets source and destination directories appropriate for the mandatory values.
 .SH FILES
 .TP
 .I /usr/share/gconf/defaults/
-The directory where defaults files are read.
+The directory from which defaults files are read.
 .TP
-.I /var/lib/gconf/debian.defaults/%gconf-tree.xml
-The value tree generated. It is read by GConf with the default Debian
+.I /usr/share/gconf/mandatory/
+The directory from which defaults files for mandatory settings are read.
+.TP
+.I /var/lib/gconf/debian.defaults
+The directory where the GConf tree for default settings is generated. It is read by GConf with the default Debian
 configuration, and it takes precedence over upstream defaults.
+.TP
+.I /var/lib/gconf/debian.mandatory
+The directory where the GConf tree for mandatory settings is generated. It is read by GConf with the default Debian configuration, and it takes precedence over user settings.
 .SH SEE ALSO
 .BR dh_gconf (1), gconftool (1).
Index: /pkg/boss/main/gconf/trunk/debian/changelog
===================================================================
--- /pkg/boss/main/gconf/trunk/debian/changelog	(revision 4980)
+++ /pkg/boss/main/gconf/trunk/debian/changelog	(revision 4981)
@@ -1,8 +1,37 @@
-gconf (2.24.0-parsix3) unstable; urgency=low
-
-  * Merged updates from Debian 2.24.0-4
-  * Updated 80_fix_su_dbus.patch
-
- -- Alan Baghumian <alan@technotux.org>  Sun, 18 Jan 2009 13:17:11 -0800
+gconf (2.24.0-parsix4) unstable; urgency=low
+
+  * Sync'd with Debian 2.24.0-5
+
+ -- Alan Baghumian <alan@technotux.org>  Sun, 08 Feb 2009 09:28:26 -0800
+
+gconf (2.24.0-5) experimental; urgency=low
+
+  [ Josselin Mouette ]
+  * Add a Breaks against older libbonobos because gconf using dbus makes 
+    #331000 occur much more often.
+
+  [ Loic Minier ]
+  * Change the postinst to explicitely install the alternative on install and
+    upgrades from << 2.19.1-2.
+
+  [ Josselin Mouette ]
+  * update-gconf-defaults: ignore more backup extensions.
+    Closes: #512476.
+  * gconf-schemas: add a --no-signal option.
+  * gconf2.postinst: improve the detection of cases when daemons need to 
+    be signalled.
+  * Support alternate installation paths for defaults, including setting 
+    mandatory settings. Closes: #512474, #512947.
+    + update-gconf-defaults: implement the --source, --destination, 
+      --no-signal and --mandatory options.
+    + update-gconf-defaults.8: document them.
+    + default.path: add /var/lib/gconf/debian.mandatory as a mandatory 
+      source.
+    + gconf2-common.dirs: add new directories.
+    + gconf2.postinst: run update-gconf-defaults --mandatory if needed.
+    + gconf2.install: install the script to /usr/bin.
+    + README.Debian: document this.
+
+ -- Josselin Mouette <joss@debian.org>  Mon, 02 Feb 2009 14:14:55 +0100
 
 gconf (2.24.0-4) experimental; urgency=low
Index: /pkg/boss/main/gconf/trunk/debian/gconf2.postinst
===================================================================
--- /pkg/boss/main/gconf/trunk/debian/gconf2.postinst	(revision 4980)
+++ /pkg/boss/main/gconf/trunk/debian/gconf2.postinst	(revision 4981)
@@ -1,10 +1,18 @@
 #!/bin/sh
+
 set -e
 
-if [ "$1" != "configure" ] || dpkg --compare-versions "$2" lt 2.19.1-2; then
+install_alternative() {
     update-alternatives \
-	--install /usr/bin/gconftool gconftool /usr/bin/gconftool-2 25 \
-	--slave /usr/share/man/man1/gconftool.1.gz gconftool.1.gz \
-		/usr/share/man/man1/gconftool-2.1.gz
+        --install /usr/bin/gconftool gconftool /usr/bin/gconftool-2 25 \
+        --slave /usr/share/man/man1/gconftool.1.gz gconftool.1.gz \
+                /usr/share/man/man1/gconftool-2.1.gz
+}
+
+if [ "$1" = install ]; then
+    install_alternative
+fi
+if [ "$1" = configure ] && dpkg --compare-versions "$2" lt-nl 2.19.1-2; then
+    install_alternative
 fi
 
@@ -12,6 +20,6 @@
 
 for GCONF_DIR in /var/lib/gconf/defaults \
-		 /etc/gconf/gconf.xml.mandatory \
-		 /etc/gconf/gconf.xml.defaults ; do
+                 /etc/gconf/gconf.xml.mandatory \
+                 /etc/gconf/gconf.xml.defaults ; do
   GCONF_TREE=$GCONF_DIR/%gconf-tree.xml
   if [ ! -f "$GCONF_TREE" ]; then
@@ -28,12 +36,17 @@
     # First installation: rebuild the defaults database in case 
     # of packages shipping schemas but not depending on gconf2
-    gconf-schemas --register-all
-    SIGNAL_DAEMONS=no
+    gconf-schemas --register-all --no-signal
+    SIGNAL_DAEMONS=yes
   fi
 fi
 if [ -d /usr/share/gconf/defaults ] && [ ! -s /var/lib/gconf/debian.defaults/%gconf-tree.xml ]; then
   # Same for the defaults
-  update-gconf-defaults
-  SIGNAL_DAEMONS=no
+  update-gconf-defaults --no-signal
+  SIGNAL_DAEMONS=yes
+fi
+if [ -d /usr/share/gconf/mandatory ] && [ ! -s /var/lib/gconf/debian.mandatory/%gconf-tree.xml ]; then
+  # Same for the mandatory settings
+  update-gconf-defaults --no-signal --mandatory
+  SIGNAL_DAEMONS=yes
 fi
 
Index: /pkg/boss/main/gconf/trunk/debian/gconf2-common.dirs
===================================================================
--- /pkg/boss/main/gconf/trunk/debian/gconf2-common.dirs	(revision 4980)
+++ /pkg/boss/main/gconf/trunk/debian/gconf2-common.dirs	(revision 4981)
@@ -3,4 +3,6 @@
 /etc/gconf/gconf.xml.defaults
 /usr/share/gconf/defaults
+/usr/share/gconf/mandatory
 /var/lib/gconf/defaults
 /var/lib/gconf/debian.defaults
+/var/lib/gconf/debian.mandatory
Index: /pkg/boss/main/gconf/trunk/debian/gconf-schemas.xml
===================================================================
--- /pkg/boss/main/gconf/trunk/debian/gconf-schemas.xml	(revision 4980)
+++ /pkg/boss/main/gconf/trunk/debian/gconf-schemas.xml	(revision 4981)
@@ -84,4 +84,11 @@
 		</listitem>
 	  </varlistentry>
+	  <varlistentry>
+	    <term><option>--no-signal</option>
+	    </term>
+	    <listitem>
+	      <para>do not send SIGHUP to the running gconfd-2 processes.</para>
+	    </listitem>
+	  </varlistentry>
     </variablelist>
   </refsect1>
Index: /pkg/boss/main/gconf/trunk/debian/gconf-schemas
===================================================================
--- /pkg/boss/main/gconf/trunk/debian/gconf-schemas	(revision 4980)
+++ /pkg/boss/main/gconf/trunk/debian/gconf-schemas	(revision 4981)
@@ -19,5 +19,6 @@
                    help="clean up the GConf database and register all schemas again",
                    default=False)
-
+parser.add_option("--no-signal", action="store_false", default=True, dest="signal",
+                  help="do not send SIGHUP the running gconfd-2 processes")
 (options, args) = parser.parse_args()
 
@@ -75,5 +76,5 @@
   sys.exit(res)
 
-if options.register:
+if options.register and options.signal:
   # tell running processes to re-read the GConf database
   import signal
Index: /pkg/boss/main/gconf/trunk/debian/README.Debian
===================================================================
--- /pkg/boss/main/gconf/trunk/debian/README.Debian	(revision 4980)
+++ /pkg/boss/main/gconf/trunk/debian/README.Debian	(revision 4981)
@@ -2,9 +2,15 @@
 ==================
 
-The default GConf sources accessed by the GConf daemon are the following:
+The default GConf sources accessed by the GConf daemon are the 
+following, in order:
 
 * /etc/gconf/gconf.xml.mandatory/
   Mandatory settings set by the administrator. You can edit them with
   gconf-editor, as root, to override any user settings.
+
+* /var/lib/gconf/debian.mandatory/
+  This directory contains mandatory settings provided by Debian, CDD or 
+  local packages.  Mandatory settings are shipped in 
+  /usr/share/gconf/mandatory and set by update-gconf-defaults.
 
 * ~/.gconf/
@@ -34,6 +40,6 @@
 situation (tree of %gconf.xml files) is done in gconf2 2.12.1-5.
 
-By default, the home directory structure is created as a tree layout. If
-you want to use a merged tree on the home directory, you should run the
-following command:
+By default, the home directory structure is created as a tree layout 
+since it improves write performance. If you want to use a merged tree 
+on the home directory, you should run the following command:
   gconf-merge-tree ~/.gconf/
