Bug#659717: dspam: use dh_installdeb maintscript support

2012-02-14 Thread Julien Valroff
tags 659717 + pending
thanks

Le lundi 13 févr. 2012 à 13:22:00 (+0100 CET), Colin Watson a écrit :
[...]
   * 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.

Thanks a lot for your patch which has just been applied to git HEAD. The
changes will be part of the next upload which should happen as soon as the
next upstream version is released.

Cheers,
Julien

-- 
  .''`.   Julien Valroff ~ jul...@kirya.net ~ jul...@debian.org
 : :'  :  Debian Developer  Free software contributor
 `. `'`   http://www.kirya.net/
   `- 4096R/ E1D8 5796 8214 4687 E416  948C 859F EF67 258E 26B1



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



Bug#659717: dspam: use dh_installdeb maintscript support

2012-02-13 Thread Colin Watson
Package: dspam
Version: 3.10.1+dfsg-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
dspam-webfrontend/libdspam7-drv-mysql/libdspam7-drv-sqlite3.  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 could remove some of your handwritten maintainer scripts
entirely.  Here's a patch (you already had a sufficient Build-Depends on
debhelper, and several of the necessary Pre-Depends:
${misc:Pre-Depends} were already present):

  * 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 dspam-3.10.1+dfsg/debian/control dspam-3.10.1+dfsg/debian/control
--- dspam-3.10.1+dfsg/debian/control2011-08-21 20:54:29.0 +0100
+++ dspam-3.10.1+dfsg/debian/control2012-02-13 10:39:38.0 +
@@ -35,6 +35,7 @@
 Package: dspam-webfrontend
 Priority: extra
 Architecture: all
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends}, ${perl:Depends}, dspam (= ${source:Version}), ucf 
(= 0.28), libgd-gd2-perl | libgd-gd2-noxpm-perl, libgd-graph3d-perl, 
libhtml-parser-perl
 Suggests: apache2, apache2-suexec (= 2.2.9-3), libapache2-mod-perl2, 
libapache2-mod-auth-pam | libapache2-mod-auth-mysql | libapache2-mod-auth-pgsql 
| libapache2-mod-auth-openid | libapache2-mod-auth-kerb | 
libapache2-mod-auth-plain | libapache2-mod-auth-radius | 
libapache2-mod-auth-sys-group, ttf-dejavu-core | ttf-bitstream-vera | 
ttf-freefont
 Description: Webfrontend for DSPAM anti-spam filter
diff -Nru dspam-3.10.1+dfsg/debian/dspam-webfrontend.maintscript 
dspam-3.10.1+dfsg/debian/dspam-webfrontend.maintscript
--- dspam-3.10.1+dfsg/debian/dspam-webfrontend.maintscript  1970-01-01 
01:00:00.0 +0100
+++ dspam-3.10.1+dfsg/debian/dspam-webfrontend.maintscript  2012-02-13 
10:34:37.0 +
@@ -0,0 +1,2 @@
+rm_conffile /etc/dspam/dspam-apache.conf 3.9.1~rc1+git20110419.29261fb+dfsg-2
+rm_conffile /etc/dspam/dspam-apache2.conf 3.9.1~rc1+git20110419.29261fb+dfsg-2
diff -Nru dspam-3.10.1+dfsg/debian/dspam-webfrontend.postinst 
dspam-3.10.1+dfsg/debian/dspam-webfrontend.postinst
--- dspam-3.10.1+dfsg/debian/dspam-webfrontend.postinst 2011-08-21 
20:54:29.0 +0100
+++ dspam-3.10.1+dfsg/debian/dspam-webfrontend.postinst 2012-02-13 
10:34:46.0 +
@@ -33,12 +33,6 @@
 ;;
 esac
 
-# Remove old conffiles
-if dpkg-maintscript-helper supports rm_conffile /dev/null 21; then
-dpkg-maintscript-helper rm_conffile /etc/dspam/dspam-apache.conf 
3.9.1~rc1+git20110419.29261fb+dfsg-2 -- $@
-dpkg-maintscript-helper rm_conffile /etc/dspam/dspam-apache2.conf 
3.9.1~rc1+git20110419.29261fb+dfsg-2 -- $@
-fi
-
 #DEBHELPER#
 
 exit 0
diff -Nru dspam-3.10.1+dfsg/debian/dspam-webfrontend.postrm 
dspam-3.10.1+dfsg/debian/dspam-webfrontend.postrm
--- dspam-3.10.1+dfsg/debian/dspam-webfrontend.postrm   2011-08-21 
20:54:29.0 +0100
+++ dspam-3.10.1+dfsg/debian/dspam-webfrontend.postrm   2012-02-13 
10:34:49.0 +
@@ -37,12 +37,6 @@
 
 esac
 
-# Remove old conffiles
-if dpkg-maintscript-helper supports rm_conffile /dev/null 21; then
-dpkg-maintscript-helper rm_conffile /etc/dspam/dspam-apache.conf 
3.9.1~rc1+git20110419.29261fb+dfsg-2 -- $@
-dpkg-maintscript-helper rm_conffile /etc/dspam/dspam-apache2.conf 
3.9.1~rc1+git20110419.29261fb+dfsg-2 -- $@
-fi
-
 #DEBHELPER#
 
 exit 0
diff -Nru dspam-3.10.1+dfsg/debian/dspam-webfrontend.preinst 
dspam-3.10.1+dfsg/debian/dspam-webfrontend.preinst
--- dspam-3.10.1+dfsg/debian/dspam-webfrontend.preinst  2011-08-21 
20:54:29.0 +0100
+++ dspam-3.10.1+dfsg/debian/dspam-webfrontend.preinst  2012-02-13 
10:34:44.0 +
@@ -19,12 +19,6 @@
 ;;  
 esac
 
-# Remove old conffiles
-if dpkg-maintscript-helper supports rm_conffile /dev/null 21; then
-dpkg-maintscript-helper rm_conffile /etc/dspam/dspam-apache.conf 
3.9.1~rc1+git20110419.29261fb+dfsg-2 -- $@
-dpkg-maintscript-helper rm_conffile /etc/dspam/dspam-apache2.conf 
3.9.1~rc1+git20110419.29261fb+dfsg-2 -- $@
-fi
-
 #DEBHELPER#
 
 exit 0
diff -Nru dspam-3.10.1+dfsg/debian/libdspam7-drv-mysql.maintscript