summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2012-05-28 13:40:05 -0400
committerJoey Hess <joey@kitenet.net>2012-05-28 13:46:14 -0400
commit0ecce5d6f0ea6e7fd91216bb293d8ec769172c4c (patch)
tree5fb30299e7d6321e61bd4bb08ed3b9c58ce11075
parentbad9a3274d4390ea70bf0de97eea1fbe6500f045 (diff)
dh_installcatalogs: Turn /etc/sgml/$package.cat into conffiles and introduce dependency on trigger-based sgml-base. Closes: #477751 Thanks, Helmut Grohne
-rw-r--r--autoscripts/postinst-sgmlcatalog7
-rw-r--r--autoscripts/postrm-sgmlcatalog2
-rw-r--r--autoscripts/preinst-sgmlcatalog7
-rw-r--r--autoscripts/prerm-sgmlcatalog3
-rw-r--r--debian/changelog8
-rwxr-xr-xdh_installcatalogs16
6 files changed, 26 insertions, 17 deletions
diff --git a/autoscripts/postinst-sgmlcatalog b/autoscripts/postinst-sgmlcatalog
deleted file mode 100644
index 100dee2f..00000000
--- a/autoscripts/postinst-sgmlcatalog
+++ /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
diff --git a/autoscripts/postrm-sgmlcatalog b/autoscripts/postrm-sgmlcatalog
index 168a6949..f8278e68 100644
--- a/autoscripts/postrm-sgmlcatalog
+++ b/autoscripts/postrm-sgmlcatalog
@@ -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
index 00000000..41f55d6d
--- /dev/null
+++ b/autoscripts/preinst-sgmlcatalog
@@ -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
index d6f6fa7a..00000000
--- a/autoscripts/prerm-sgmlcatalog
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ "$1" = "remove" ] || [ "$1" = "upgrade" ]; then
- update-catalog --quiet --remove --super #CENTRALCAT#
-fi
diff --git a/debian/changelog b/debian/changelog
index 053aa1ea..82482045 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
diff --git a/dh_installcatalogs b/dh_installcatalogs
index b33f897e..b3aaf5e6 100755
--- a/dh_installcatalogs
+++ b/dh_installcatalogs
@@ -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;");