Bug#512947: gconf2-common: add --mandatory capability to update-gconf-defaults

Mark Hymers mhy at debian.org
Sun Jan 25 10:53:00 UTC 2009


Package: gconf2-common
Version: 2.22.0-1
Severity: wishlist
Tags: patch

Hi,

update-gconf-defaults is very useful for local sysadmins (allowing us to
drop simple files in /usr/share/gconf/defaults in order to customise the
default behaviour of desktops).  Even more useful would be the ability
to use it for setting mandatory options in the same way instead of
writing the XML by hand.  Attached is a patch to the gconf source
package to allow this.

Obviously this isn't for use by packages in the archive, but it
certainly makes life easier for local sysadmins.

Cheers,

Mark


-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-k7
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
-------------- next part --------------
diff -Naur gconf-2.22.0/debian/default.path gconf-2.22.0-mandatory/debian/default.path
--- gconf-2.22.0/debian/default.path	2009-01-25 10:45:58.000000000 +0000
+++ gconf-2.22.0-mandatory/debian/default.path	2009-01-25 10:48:19.000000000 +0000
@@ -8,6 +8,9 @@
 # Other forced sources imagined by the local administrator
 include /etc/gconf/2/local-mandatory.path
 
+# Settings forced by the local administrator using
+# update-gconf-defaults --mandatory
+xml:readonly:/var/lib/gconf/debian.mandatory
 
 #######################
 # 2. User Preferences #
diff -Naur gconf-2.22.0/debian/gconf2-common.dirs gconf-2.22.0-mandatory/debian/gconf2-common.dirs
--- gconf-2.22.0/debian/gconf2-common.dirs	2009-01-25 10:45:58.000000000 +0000
+++ gconf-2.22.0-mandatory/debian/gconf2-common.dirs	2009-01-25 10:47:11.000000000 +0000
@@ -4,3 +4,4 @@
 /usr/share/gconf/defaults
 /var/lib/gconf/defaults
 /var/lib/gconf/debian.defaults
+/var/lib/gconf/debian.mandatory
diff -Naur gconf-2.22.0/debian/update-gconf-defaults gconf-2.22.0-mandatory/debian/update-gconf-defaults
--- gconf-2.22.0/debian/update-gconf-defaults	2009-01-25 10:45:58.000000000 +0000
+++ gconf-2.22.0-mandatory/debian/update-gconf-defaults	2009-01-25 10:38:48.000000000 +0000
@@ -102,6 +102,10 @@
     if len(l) == 2:
       gconf_val[l[0]] = l[1]
 
+if len(sys.argv) > 1:
+  if sys.argv[1] == '--mandatory':
+    defaults_dir = '/usr/share/gconf/mandatory'
+    outdir = '/var/lib/gconf/debian.mandatory'
 
 defaults_files = os.listdir(defaults_dir)
 defaults_files.sort()
diff -Naur gconf-2.22.0/debian/update-gconf-defaults.8 gconf-2.22.0-mandatory/debian/update-gconf-defaults.8
--- gconf-2.22.0/debian/update-gconf-defaults.8	2009-01-25 10:45:58.000000000 +0000
+++ gconf-2.22.0-mandatory/debian/update-gconf-defaults.8	2009-01-25 10:45:36.000000000 +0000
@@ -12,9 +12,11 @@
 .B update-gconf-defaults
 is responsible for generating defaults used by GConf from the files
 found in
-.IR /usr/share/gconf/defaults .
+.IR /usr/share/gconf/defaults
+or
+.IR /usr/share/gconf/mandatory
 .PP
-The syntax of files in this directory consists in lines containing the
+The syntax of files in these directories consist of lines containing the
 key name, some white space, and the key value, which can be an integer,
 a boolean, a float, a string or a list of strings. Example:
 .PP
@@ -41,8 +43,21 @@
 .I NN
 as 10 for packages in the Debian archive, 20 for derived distributions,
 50 for CDD distributions, and 90 for site-specific packages.
+.PP
+By default, the program will update the defaults tree.  In order for
+site administrators to be able to update the mandatory tree, the
+.B
+\fB\-\-mandatory\fR
+option should be used.
 .SH OPTIONS
-There are no options for this program.
+.TP
+\fB\-\-mandatory\fR
+If this option is passed, update-gconf-defaults will update the mandatory
+tree instead of the default tree.  This
+.B
+must
+not be used by Debian packages.  It is only for use by local system
+administrators.
 .SH FILES
 .TP
 .I /usr/share/gconf/defaults/
@@ -51,6 +66,12 @@
 .I /var/lib/gconf/debian.defaults/%gconf-tree.xml
 The value tree generated. It is read by GConf with the default Debian
 configuration, and it takes precedence over upstream defaults.
+.TP
+.I /usr/share/gconf/mandatory/
+The directory where mandatory files are read if called with --mandatory.
+.TP
+.I /var/lib/gconf/debian.mandatory/%gconf-tree.xml
+The value tree generated if called with --mandatory.
 .SH SEE ALSO
 .BR dh_gconf (1), gconftool (1).
 .SH AUTHOR


More information about the pkg-gnome-maintainers mailing list