]> git.donarmstrong.com Git - debhelper.git/commitdiff
dh_gconf: Support mandatory settings. Closes: #513923
authorJoey Hess <joey@gnu.kitenet.net>
Mon, 2 Feb 2009 18:38:11 +0000 (13:38 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Mon, 2 Feb 2009 18:38:11 +0000 (13:38 -0500)
autoscripts/postinst-gconf-defaults
autoscripts/postrm-gconf-defaults
debian/changelog
dh_gconf

index 1d84aa40ad076a914a7ae6e49916ff88c36a8308..eff244a50cb1b669a882900d3a1d0116ad3cd2ff 100644 (file)
@@ -1,3 +1,3 @@
 if [ "$1" = "configure" ] && which update-gconf-defaults >/dev/null 2>&1; then
-       update-gconf-defaults
+       update-gconf-defaults #OPT#
 fi
index 468449811d85fb1c57e03756968e4719f1a99963..b15de676796a5282d0537c8b1caa522980c71bae 100644 (file)
@@ -1,3 +1,3 @@
 if which update-gconf-defaults >/dev/null 2>&1; then
-       update-gconf-defaults
+       update-gconf-defaults #OPT#
 fi
index 0129159d9618917dbbcb66fd54b9f168259249d4..29fa6d1e34200f5f1db0442001c0ed1b5388d5c4 100644 (file)
@@ -2,6 +2,7 @@ debhelper (7.1.2) UNRELEASED; urgency=low
 
   * dh: Fix typo. Closes: #509754
   * debhelper.pod: Fix typo. Closes: #510180
+  * dh_gconf: Support mandatory settings. Closes: #513923
 
  -- Joey Hess <joeyh@debian.org>  Thu, 25 Dec 2008 16:26:36 -0500
 
index 84a6a6cc91977f2cd95cba6d883f0c4d0ffbfe14..8c30de7326f4f4cb42fee40ea44396629ce85ef8 100755 (executable)
--- a/dh_gconf
+++ b/dh_gconf
@@ -27,6 +27,11 @@ installed into usr/share/gconf/defaults/10_package in the package build
 directory, with "package" replaced by the package name. Some postinst and
 postrm fragments will be generated to launch update-gconf-defaults.
 
+If a file named debian/package.gconf-mandatory exists, then it is
+installed into usr/share/gconf/mandatory/10_package in the package build
+directory, with "package" replaced by the package name, and similar
+postinst and postrm fragments will be generated.
+
 The gconf-schemas and update-gconf-defaults scripts are provided by the
 gconf2 package. An appropriate dependency will be generated in
 ${misc:Depends}.
@@ -57,13 +62,22 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        my $tmp=tmpdir($package);
        
        my $gconf_dep = 0;
+       my $mandatory = pkgfile($package, "gconf-mandatory");
+       if ($mandatory ne '') {
+               doit("mkdir","-p","$tmp/usr/share/gconf/mandatory");
+               doit("install","-p","-m644",$mandatory,"$tmp/usr/share/gconf/mandatory/${priority}_$package");
+               autoscript($package,"postinst","postinst-gconf-defaults","s%#OPT#%--mandatory%");
+               autoscript($package,"postrm","postrm-gconf-defaults","s%#OPT#%--mandatory%");
+               addsubstvar($package, "misc:Depends", "gconf2 (>= 2.24.0-5)");
+               $gconf_dep = 1;
+       }
        my $defaults = pkgfile($package,"gconf-defaults");
        if ($defaults ne '') {
                doit("mkdir","-p","$tmp/usr/share/gconf/defaults");
                doit("install","-p","-m644",$defaults,"$tmp/usr/share/gconf/defaults/${priority}_$package");
-               autoscript($package,"postinst","postinst-gconf-defaults");
-               autoscript($package,"postrm","postrm-gconf-defaults");
-               addsubstvar($package, "misc:Depends", "gconf2 (>= 2.12.1-1)");
+               autoscript($package,"postinst","postinst-gconf-defaults","s%#OPT#%%");
+               autoscript($package,"postrm","postrm-gconf-defaults","s%#OPT#%%");
+               addsubstvar($package, "misc:Depends", "gconf2 (>= 2.12.1-1)") unless $gconf_dep;
                $gconf_dep = 1;
        }