]> git.donarmstrong.com Git - debhelper.git/commitdiff
dh_installcatalogs: Turn /etc/sgml/$package.cat into conffiles and introduce dependen...
authorJoey Hess <joey@kitenet.net>
Mon, 28 May 2012 17:40:05 +0000 (13:40 -0400)
committerJoey Hess <joey@kitenet.net>
Mon, 28 May 2012 17:46:14 +0000 (13:46 -0400)
autoscripts/postinst-sgmlcatalog [deleted file]
autoscripts/postrm-sgmlcatalog
autoscripts/preinst-sgmlcatalog [new file with mode: 0644]
autoscripts/prerm-sgmlcatalog [deleted file]
debian/changelog
dh_installcatalogs

diff --git a/autoscripts/postinst-sgmlcatalog b/autoscripts/postinst-sgmlcatalog
deleted file mode 100644 (file)
index 100dee2..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-if [ "$1" = "configure" ]; then
-       rm -f #CENTRALCAT#
-       for ordcat in #ORDCATS#; do
-               update-catalog --quiet --add #CENTRALCAT# ${ordcat}
-       done
-       update-catalog --quiet --add --super #CENTRALCAT#
-fi
index 168a6949fba2e36dae816204bf1706438be43ea7..f8278e6851745e60ea2c8f7408f95dafa584c2b0 100644 (file)
@@ -1,3 +1,3 @@
 if [ "$1" = "purge" ]; then
-       rm -f #CENTRALCAT# #CENTRALCAT#.old
+       rm -f #CENTRALCAT#.old
 fi
diff --git a/autoscripts/preinst-sgmlcatalog b/autoscripts/preinst-sgmlcatalog
new file mode 100644 (file)
index 0000000..41f55d6
--- /dev/null
@@ -0,0 +1,7 @@
+if [ "$1" = "upgrade" ] && ! dpkg-query -S #CENTRALCAT# >/dev/null 2>&1; then
+       # If the dpkg-query command returns non-zero, the central catalog is
+       # not owned by any package. This is due to an old behaviour of
+       # debhelper. Now that file becomes a conffile. In order to avoid a
+       # question during installation, we remove the old non-conffile.
+       rm -f #CENTRALCAT#
+fi
diff --git a/autoscripts/prerm-sgmlcatalog b/autoscripts/prerm-sgmlcatalog
deleted file mode 100644 (file)
index d6f6fa7..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ "$1" = "remove" ] || [ "$1" = "upgrade" ]; then
-       update-catalog --quiet --remove --super #CENTRALCAT#
-fi
index 053aa1ea71c24378160254b4d284b8c70cb3b86f..824820454278ff79463a911be63a7aef1c1b9fb1 100644 (file)
@@ -1,3 +1,11 @@
+debhelper (9.20120524) UNRELEASED; urgency=low
+
+  * dh_installcatalogs: Turn /etc/sgml/$package.cat into conffiles
+    and introduce dependency on trigger-based sgml-base. Closes: #477751
+    Thanks, Helmut Grohne
+
+ -- Joey Hess <joeyh@debian.org>  Mon, 28 May 2012 13:37:44 -0400
+
 debhelper (9.20120523) unstable; urgency=low
 
   * Spanish translation update. Closes: #673629 Thanks, Omar Campagne
index b33f897e863985941fe6242ca4237fafbaf7a3c6..b3aaf5e6dca86a0232f919c3123f725721df8266 100755 (executable)
@@ -9,7 +9,7 @@ dh_installcatalogs - install and register SGML Catalogs
 use strict;
 use Debian::Debhelper::Dh_Lib;
 
-my $sgmlbasever = "1.17";
+my $sgmlbasever = "1.26+nmu2";
 
 =head1 SYNOPSIS
 
@@ -96,12 +96,16 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                        doit("install","-d","-m755","$tmpdir/etc/sgml");
                }
 
+               my $centralcat = "/etc/sgml/$package.cat";
+
+               open(CENTRALCAT, ">", "$tmpdir$centralcat") || error("failed to write to $tmpdir$centralcat");
+               foreach my $sgmldest (@sgmlinstalled) {
+                       print CENTRALCAT "CATALOG " . $sgmldest . "\n";
+               }
+               close CENTRALCAT;
+
                if (! $dh{NOSCRIPTS}) {
-                       my $ordcats = join(" ", @sgmlinstalled);
-                       my $centralcat = "/etc/sgml/$package.cat";
-                       autoscript($package, "postinst", "postinst-sgmlcatalog",
-                                  "s%#CENTRALCAT#%$centralcat%g; s%#ORDCATS#%$ordcats%g;");
-                       autoscript($package, "prerm", "prerm-sgmlcatalog",
+                       autoscript($package, "preinst", "preinst-sgmlcatalog",
                                   "s%#CENTRALCAT#%$centralcat%g;");
                        autoscript($package, "postrm", "postrm-sgmlcatalog",
                                   "s%#CENTRALCAT#%$centralcat%g;");