From 0ecce5d6f0ea6e7fd91216bb293d8ec769172c4c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 28 May 2012 13:40:05 -0400 Subject: dh_installcatalogs: Turn /etc/sgml/$package.cat into conffiles and introduce dependency on trigger-based sgml-base. Closes: #477751 Thanks, Helmut Grohne --- autoscripts/postinst-sgmlcatalog | 7 ------- autoscripts/postrm-sgmlcatalog | 2 +- autoscripts/preinst-sgmlcatalog | 7 +++++++ autoscripts/prerm-sgmlcatalog | 3 --- debian/changelog | 8 ++++++++ dh_installcatalogs | 16 ++++++++++------ 6 files changed, 26 insertions(+), 17 deletions(-) delete mode 100644 autoscripts/postinst-sgmlcatalog create mode 100644 autoscripts/preinst-sgmlcatalog delete mode 100644 autoscripts/prerm-sgmlcatalog 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 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;"); -- cgit v1.2.3