Bug#659794: tmux: use dh_installdeb maintscript support

2012-02-14 Thread Colin Watson
On Mon, Feb 13, 2012 at 11:48:36PM +0100, Romain Francoise wrote:
> Colin Watson  writes:
> > 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.
> > Here's a patch: [...]
> 
> Nice, thanks Colin. debhelper adds a prerm script to the package with a
> no-op call to dpkg-maintscript-helper, but that's not really a concern.

Right.

> I merged your patch in Git for the next upload.

Thanks!

> I guess that also takes care of half of #648867 which I'm going to retitle
> and tag accordingly.

Yes, the postinst part of the patch in that bug is wrong for Ubuntu as
well as for Debian.  We shouldn't be using conditional paths when we can
use dependency relations to guarantee a single path.

Cheers,

-- 
Colin Watson   [cjwat...@ubuntu.com]



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



Bug#659794: tmux: use dh_installdeb maintscript support

2012-02-13 Thread Romain Francoise
Colin Watson  writes:

> 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.
> Here's a patch: [...]

Nice, thanks Colin. debhelper adds a prerm script to the package with a
no-op call to dpkg-maintscript-helper, but that's not really a concern.
I merged your patch in Git for the next upload.

I guess that also takes care of half of #648867 which I'm going to retitle
and tag accordingly.

Cheers,
-- 
Romain Francoise 
http://people.debian.org/~rfrancoise/



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



Bug#659794: tmux: use dh_installdeb maintscript support

2012-02-13 Thread Colin Watson
Package: tmux
Version: 1.6-1
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 tmux.  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.
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 tmux-1.6/debian/control tmux-1.6/debian/control
--- tmux-1.6/debian/control 2012-01-23 18:25:26.0 +
+++ tmux-1.6/debian/control 2012-02-13 18:46:04.0 +
@@ -14,6 +14,7 @@
 
 Package: tmux
 Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: terminal multiplexer
  tmux enables a number of terminals (or windows) to be accessed and
diff -Nru tmux-1.6/debian/maintscript tmux-1.6/debian/maintscript
--- tmux-1.6/debian/maintscript 1970-01-01 01:00:00.0 +0100
+++ tmux-1.6/debian/maintscript 2012-02-13 18:45:18.0 +
@@ -0,0 +1 @@
+rm_conffile /etc/init.d/tmux-cleanup 1.4-6
diff -Nru tmux-1.6/debian/postinst tmux-1.6/debian/postinst
--- tmux-1.6/debian/postinst2012-01-23 18:25:26.0 +
+++ tmux-1.6/debian/postinst2012-02-13 18:45:34.0 +
@@ -2,10 +2,6 @@
 
 set -e
 
-if dpkg-maintscript-helper supports rm_conffile; then
-dpkg-maintscript-helper rm_conffile /etc/init.d/tmux-cleanup 1.4-6 -- "$@"
-fi
-
 if [ "$1" = "configure" ]; then
 if [ -z "$2" ] || dpkg --compare-versions "$2" lt "1.5-3"; then
add-shell /usr/bin/tmux
diff -Nru tmux-1.6/debian/postrm tmux-1.6/debian/postrm
--- tmux-1.6/debian/postrm  2012-01-23 18:25:26.0 +
+++ tmux-1.6/debian/postrm  2012-02-13 18:45:37.0 +
@@ -2,10 +2,6 @@
 
 set -e
 
-if dpkg-maintscript-helper supports rm_conffile; then
-dpkg-maintscript-helper rm_conffile /etc/init.d/tmux-cleanup 1.4-6 -- "$@"
-fi
-
 if [ "$1" = "remove" ]; then
 remove-shell /usr/bin/tmux
 fi
diff -Nru tmux-1.6/debian/preinst tmux-1.6/debian/preinst
--- tmux-1.6/debian/preinst 2012-01-23 18:25:26.0 +
+++ tmux-1.6/debian/preinst 2012-02-13 18:45:41.0 +
@@ -7,8 +7,4 @@
 update-rc.d -f tmux-cleanup remove >/dev/null
 fi
 
-if dpkg-maintscript-helper supports rm_conffile; then
-dpkg-maintscript-helper rm_conffile /etc/init.d/tmux-cleanup 1.4-6 -- "$@"
-fi
-
 #DEBHELPER#

Thanks,

-- 
Colin Watson   [cjwat...@ubuntu.com]



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