Bug#659756: freeipmi-bmc-watchdog: use dh_installdeb maintscript support

2012-02-13 Thread Colin Watson
Package: freeipmi-bmc-watchdog
Version: 0.8.12-3
Severity: wishlist
Tags: patch
User: ubuntu-de...@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
freeipmi-bmc-watchdog.  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 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 freeipmi-0.8.12/debian/control freeipmi-0.8.12/debian/control
--- freeipmi-0.8.12/debian/control  2011-07-19 03:28:12.0 +0100
+++ freeipmi-0.8.12/debian/control  2012-02-13 15:33:56.0 +
@@ -2,7 +2,7 @@
 Section: admin
 Priority: extra
 Maintainer: Yaroslav Halchenko deb...@onerussian.com
-Build-Depends: debhelper (= 7.0.50~),
+Build-Depends: debhelper (= 8.1.0~),
  autotools-dev, 
  libgcrypt11-dev,
  chrpath,
@@ -59,6 +59,7 @@
 Package: freeipmi-bmc-watchdog
 Section: admin
 Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${shlibs:Depends}, ${misc:Depends}, freeipmi-tools
 Description: GNU implementation of the IPMI protocol - BMC watchdog
  FreeIPMI is a collection of Intelligent Platform Management IPMI
diff -Nru freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.maintscript 
freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.maintscript
--- freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.maintscript1970-01-01 
01:00:00.0 +0100
+++ freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.maintscript2012-02-13 
15:32:47.0 +
@@ -0,0 +1,3 @@
+mv_conffile /etc/default/freeipmi-bmc-watchdog /etc/default/bmc-watchdog 
0.7.17~beta2-1
+mv_conffile /etc/init.d/freeipmi-bmc-watchdog /etc/init.d/bmc-watchdog 
0.7.17~beta2-1
+mv_conffile /etc/logrotate.d/freeipmi-bmc-watchdog 
/etc/logrotate.d/bmc-watchdog 0.7.17~beta2-1
diff -Nru freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.postinst 
freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.postinst
--- freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.postinst   2011-07-19 
03:28:12.0 +0100
+++ freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.postinst   1970-01-01 
01:00:00.0 +0100
@@ -1,16 +0,0 @@
-#!/bin/sh
-# postinst script for freeipmi-bmc-watchdog
-#
-# see: dh_installdeb(1)
-
-set -e
-
-if dpkg-maintscript-helper supports mv_conffile 2/dev/null; then
-dpkg-maintscript-helper mv_conffile /etc/default/freeipmi-bmc-watchdog 
/etc/default/bmc-watchdog 0.7.17~beta2-1 -- $@
-dpkg-maintscript-helper mv_conffile /etc/init.d/freeipmi-bmc-watchdog 
/etc/init.d/bmc-watchdog 0.7.17~beta2-1 -- $@
-dpkg-maintscript-helper mv_conffile /etc/logrotate.d/freeipmi-bmc-watchdog 
/etc/logrotate.d/bmc-watchdog 0.7.17~beta2-1 -- $@
-fi
-
-#DEBHELPER#
-
-exit 0
diff -Nru freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.postrm 
freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.postrm
--- freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.postrm 2011-07-19 
03:28:12.0 +0100
+++ freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.postrm 1970-01-01 
01:00:00.0 +0100
@@ -1,16 +0,0 @@
-#!/bin/sh
-# postrm script for freeipmi-bmc-watchdog
-#
-# see: dh_installdeb(1)
-
-set -e
-
-if dpkg-maintscript-helper supports mv_conffile 2/dev/null; then
-dpkg-maintscript-helper mv_conffile /etc/default/freeipmi-bmc-watchdog 
/etc/default/bmc-watchdog 0.7.17~beta2-1 -- $@
-dpkg-maintscript-helper mv_conffile /etc/init.d/freeipmi-bmc-watchdog 
/etc/init.d/bmc-watchdog 0.7.17~beta2-1 -- $@
-dpkg-maintscript-helper mv_conffile /etc/logrotate.d/freeipmi-bmc-watchdog 
/etc/logrotate.d/bmc-watchdog 0.7.17~beta2-1 -- $@
-fi
-
-#DEBHELPER#
-
-exit 0
diff -Nru freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.preinst 
freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.preinst
--- freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.preinst2011-07-19 
03:28:12.0 +0100
+++ freeipmi-0.8.12/debian/freeipmi-bmc-watchdog.preinst1970-01-01 
01:00:00.0 +0100
@@ -1,17 +0,0 @@
-#!/bin/sh
-# preinst script for freeipmi-bmc-watchdog
-#
-# see: dh_installdeb(1)
-
-set -e
-
-if dpkg-maintscript-helper supports mv_conffile 2/dev/null; then
-

Bug#659756: freeipmi-bmc-watchdog: use dh_installdeb maintscript support

2012-02-13 Thread Yaroslav Halchenko
Thanks Colin!

My only concern with it would be my own use of it on Debian stable which
has 8.0.0 (although may be I could progress to backported one or just
maintain that backport-specific patch).

Related question -- interested in co-maintaining freeipmi in Debian?  I
have started preparing for the transition to 1.x series but never got to
finalize it...

related RFH:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=628062

I have pushed all my changes (including debian/TODO) to
http://git.onerussian.com/?p=deb/freeipmi.git

Cheers,

 Package: freeipmi-bmc-watchdog
 Version: 0.8.12-3
 Severity: wishlist
 Tags: patch
 User: ubuntu-de...@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
 freeipmi-bmc-watchdog.  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.)
-- 
=--=
Keep in touch www.onerussian.com
Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#659756: freeipmi-bmc-watchdog: use dh_installdeb maintscript support

2012-02-13 Thread Colin Watson
On Mon, Feb 13, 2012 at 11:02:03AM -0500, Yaroslav Halchenko wrote:
 My only concern with it would be my own use of it on Debian stable which
 has 8.0.0 (although may be I could progress to backported one or just
 maintain that backport-specific patch).

A reasonable backport-friendly alternative would be to drop the
'dpkg-maintscript-helper supports' guards and add Pre-Depends: dpkg (=
1.15.7.2~).

 Related question -- interested in co-maintaining freeipmi in Debian?  I
 have started preparing for the transition to 1.x series but never got to
 finalize it...

I'm afraid I don't use it so I'd be a rubbish co-maintainer; this bug
was one of 30+ I've filed over the last couple of days on a variety of
packages with the same problem, rather than indicating a specific
interest in freeipmi.

Thanks,

-- 
Colin Watson   [cjwat...@debian.org]



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org