Package: debhelper
Severity: wishlist
Version: 7.1.1
Tags: patch

Hi,

please find attached a patch to add support for GConf mandatory settings
to dh_gconf. It allows Debian packages to set mandatory settings. This
is mostly meant for CDDs and local packages, of course.

Cheers,
-- 
 .''`.
: :' :      We are debian.org. Lower your prices, surrender your code.
`. `'       We will add your hardware and software distinctiveness to
  `-        our own. Resistance is futile.
diff -pruN debhelper-7.1.1.orig/autoscripts/postinst-gconf-defaults debhelper-7.1.1/autoscripts/postinst-gconf-defaults
--- debhelper-7.1.1.orig/autoscripts/postinst-gconf-defaults	2007-12-31 23:45:13.000000000 +0100
+++ debhelper-7.1.1/autoscripts/postinst-gconf-defaults	2009-02-02 14:01:23.734760644 +0100
@@ -1,3 +1,3 @@
 if [ "$1" = "configure" ] && which update-gconf-defaults >/dev/null 2>&1; then
-	update-gconf-defaults
+	update-gconf-defaults #OPT#
 fi
diff -pruN debhelper-7.1.1.orig/autoscripts/postrm-gconf-defaults debhelper-7.1.1/autoscripts/postrm-gconf-defaults
--- debhelper-7.1.1.orig/autoscripts/postrm-gconf-defaults	2007-12-31 23:45:13.000000000 +0100
+++ debhelper-7.1.1/autoscripts/postrm-gconf-defaults	2009-02-02 14:01:27.322253678 +0100
@@ -1,3 +1,3 @@
 if which update-gconf-defaults >/dev/null 2>&1; then
-	update-gconf-defaults
+	update-gconf-defaults #OPT#
 fi
diff -pruN debhelper-7.1.1.orig/dh_gconf debhelper-7.1.1/dh_gconf
--- debhelper-7.1.1.orig/dh_gconf	2008-07-31 18:27:07.000000000 +0200
+++ debhelper-7.1.1/dh_gconf	2009-02-02 14:07:22.378753875 +0100
@@ -27,6 +27,11 @@ installed into usr/share/gconf/defaults/
 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;
 	}
 

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée

Reply via email to