[Pkg-puppet-devel] Bug#659612: puppet: use dh_installdeb maintscript support

Colin Watson cjwatson at ubuntu.com
Sun Feb 12 15:13:02 UTC 2012


Package: puppet
Version: 2.7.9-1
Severity: wishlist
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch precise

Using 'dpkg-maintscript-helper supports rm_conffile' guards introduces
unreliability into upgrades; it means that the conffile is removed or
not depending on whether dpkg happens to be unpacked before puppet.
This seems generally undesirable; it would be better to enforce a single
code path.  (This is academic for Debian because the version of dpkg in
squeeze supported dpkg-maintscript-helper, hence Severity: wishlist;
Ubuntu's last LTS release didn't have a sufficient version of dpkg for
that which is why I care.)

It would be nice to just use dh_installdeb's support for generating
dpkg-maintscript-helper commands, which was introduced in debhelper
8.1.0.  This would remove duplicate code from your maintainer scripts -
in fact, you'd no longer need to have handwritten maintainer scripts for
puppet at all.  Here's a patch:

  * Use maintscript support in dh_installdeb rather than writing out
    dpkg-maintscript-helper commands by hand.  We now simply Pre-Depend on a
    new enough version of dpkg rather than using 'dpkg-maintscript-helper
    supports' guards, leading to more predictable behaviour on upgrades.

diff -Nru puppet-2.7.9/debian/control puppet-2.7.9/debian/control
--- puppet-2.7.9/debian/control	2011-12-10 11:16:47.000000000 +0000
+++ puppet-2.7.9/debian/control	2012-02-12 15:07:31.000000000 +0000
@@ -4,7 +4,7 @@
 Maintainer: Puppet Package Maintainers <pkg-puppet-devel at lists.alioth.debian.org>
 Uploaders: Micah Anderson <micah at debian.org>, Andrew Pollock <apollock at debian.org>, Nigel Kersten <nigel at explanatorygap.net>, Stig Sandbeck Mathisen <ssm at debian.org>
 Build-Depends-Indep: ruby (>= 1.8.1), libopenssl-ruby, facter (>= 1.5)
-Build-Depends: debhelper (>= 6.0.7~), openssl
+Build-Depends: debhelper (>= 8.1.0~), openssl
 Standards-Version: 3.9.2
 Vcs-Git: git://git.debian.org/git/pkg-puppet/puppet.git
 Vcs-Browser: http://git.debian.org/?p=pkg-puppet/puppet.git
@@ -34,6 +35,7 @@
 
 Package: puppet
 Architecture: all
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends},  puppet-common (= ${binary:Version}), ruby1.8
 Recommends: rdoc
 Suggests: puppet-el, vim-puppet, etckeeper
diff -Nru puppet-2.7.9/debian/puppet.maintscript puppet-2.7.9/debian/puppet.maintscript
--- puppet-2.7.9/debian/puppet.maintscript	1970-01-01 01:00:00.000000000 +0100
+++ puppet-2.7.9/debian/puppet.maintscript	2012-02-12 15:10:59.000000000 +0000
@@ -0,0 +1,4 @@
+# Remove renamed configuration files which are now handled by other packages
+rm_conffile /etc/logrotate.d/puppet 2.6.4-2
+rm_conffile /etc/logcheck/ignore.d.server/puppet 2.6.4-2
+rm_conffile /etc/emacs/site-start.d/50puppet-mode-init.el 2.6.4-2
diff -Nru puppet-2.7.9/debian/puppet.postinst puppet-2.7.9/debian/puppet.postinst
--- puppet-2.7.9/debian/puppet.postinst	2011-12-10 11:16:47.000000000 +0000
+++ puppet-2.7.9/debian/puppet.postinst	1970-01-01 01:00:00.000000000 +0100
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-set -e
-
-# Remove renamed configuration files which are now handled by other
-# packages
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-
-    dpkg-maintscript-helper rm_conffile \
-        /etc/logrotate.d/puppet 2.6.4-2 puppet -- "$@"
-
-    dpkg-maintscript-helper rm_conffile \
-        /etc/logcheck/ignore.d.server/puppet 2.6.4-2 puppet -- "$@"
-
-    dpkg-maintscript-helper rm_conffile \
-        /etc/emacs/site-start.d/50puppet-mode-init.el 2.6.4-2 puppet -- "$@"
-
-fi
-
-#DEBHELPER#
diff -Nru puppet-2.7.9/debian/puppet.postrm puppet-2.7.9/debian/puppet.postrm
--- puppet-2.7.9/debian/puppet.postrm	2011-12-10 11:16:47.000000000 +0000
+++ puppet-2.7.9/debian/puppet.postrm	1970-01-01 01:00:00.000000000 +0100
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-set -e
-
-# Remove renamed configuration files which are now handled by other
-# packages
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-
-    dpkg-maintscript-helper rm_conffile \
-        /etc/logrotate.d/puppet 2.6.4-2 puppet -- "$@"
-
-    dpkg-maintscript-helper rm_conffile \
-        /etc/logcheck/ignore.d.server/puppet 2.6.4-2 puppet -- "$@"
-
-    dpkg-maintscript-helper rm_conffile \
-        /etc/emacs/site-start.d/50puppet-mode-init.el 2.6.4-2 puppet -- "$@"
-
-fi
-
-#DEBHELPER#
diff -Nru puppet-2.7.9/debian/puppet.preinst puppet-2.7.9/debian/puppet.preinst
--- puppet-2.7.9/debian/puppet.preinst	2011-12-10 11:16:47.000000000 +0000
+++ puppet-2.7.9/debian/puppet.preinst	1970-01-01 01:00:00.000000000 +0100
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-set -e
-
-# Remove renamed configuration files which are now handled by other
-# packages
-if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
-
-    dpkg-maintscript-helper rm_conffile \
-        /etc/logrotate.d/puppet 2.6.4-2 puppet -- "$@"
-
-    dpkg-maintscript-helper rm_conffile \
-        /etc/logcheck/ignore.d.server/puppet 2.6.4-2 puppet -- "$@"
-
-    dpkg-maintscript-helper rm_conffile \
-        /etc/emacs/site-start.d/50puppet-mode-init.el 2.6.4-2 puppet -- "$@"
-
-fi
-
-#DEBHELPER#

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]





More information about the Pkg-puppet-devel mailing list