From 212a0270fffcf09f345e6290e56069c71b6d8419 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Mon, 7 Jun 2010 14:31:10 +0200 Subject: [PATCH] Use update-alternatives instead of a diversion for /usr/bin/mutt. --- debian/changelog | 2 ++ debian/mutt-patched.postinst | 17 +++++++++++++++++ debian/mutt-patched.postrm | 10 ---------- debian/mutt-patched.preinst | 14 -------------- debian/mutt-patched.prerm | 13 +++++++++++++ debian/mutt.postinst | 11 +++++++++++ debian/mutt.prerm | 13 +++++++++++++ debian/rules | 9 ++++----- 8 files changed, 60 insertions(+), 29 deletions(-) create mode 100644 debian/mutt-patched.postinst delete mode 100644 debian/mutt-patched.postrm delete mode 100644 debian/mutt-patched.preinst create mode 100644 debian/mutt-patched.prerm create mode 100644 debian/mutt.postinst create mode 100644 debian/mutt.prerm diff --git a/debian/changelog b/debian/changelog index 25d22c8..fb63205 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ mutt (1.5.20-9~unrel) UNRELEASED; urgency=low * hurd-i386 fixes: + Use libgdbm-dev for this arch until libtokyocabinet-dev is available. + * /usr/bin/mutt is an alternative now, instead of a diversion in + mutt-patched. -- Christoph Berg Sun, 06 Jun 2010 12:58:59 +0200 diff --git a/debian/mutt-patched.postinst b/debian/mutt-patched.postinst new file mode 100644 index 0000000..90ebb1a --- /dev/null +++ b/debian/mutt-patched.postinst @@ -0,0 +1,17 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ] ; then + # versions prior to 1.5.20-9 used dpkg-divert instead of update-alternatives + if [ "$2" ] && dpkg --compare-versions "$2" lt "1.5.20-9" ; then + dpkg-divert --remove --package mutt-patched --rename \ + --divert /usr/bin/mutt.org /usr/bin/mutt + fi + + update-alternatives --install /usr/bin/mutt mutt /usr/bin/mutt-patched 60 +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/mutt-patched.postrm b/debian/mutt-patched.postrm deleted file mode 100644 index 39a1eec..0000000 --- a/debian/mutt-patched.postrm +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -e - -if [ "$1" = remove ] ; then - dpkg-divert --remove --package mutt-patched --rename \ - --divert /usr/bin/mutt.org /usr/bin/mutt -fi - -#DEBHELPER# - -exit 0 diff --git a/debian/mutt-patched.preinst b/debian/mutt-patched.preinst deleted file mode 100644 index 86fce1b..0000000 --- a/debian/mutt-patched.preinst +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -e - -# Divert mutt to mutt.org so the binary from mutt-patched can replace it. -# We do not need to divert the debugging symbols in the mutt-dbg package -# as the debugging link in there points to the correct file in any case. - -if [ "$1" = install ] || [ "$1" = upgrade ] ; then - dpkg-divert --add --package mutt-patched --rename \ - --divert /usr/bin/mutt.org /usr/bin/mutt -fi - -#DEBHELPER# - -exit 0 diff --git a/debian/mutt-patched.prerm b/debian/mutt-patched.prerm new file mode 100644 index 0000000..7117be4 --- /dev/null +++ b/debian/mutt-patched.prerm @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in + remove|deconfigure) + update-alternatives --remove mutt /usr/bin/mutt-patched + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/mutt.postinst b/debian/mutt.postinst new file mode 100644 index 0000000..f185315 --- /dev/null +++ b/debian/mutt.postinst @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ] ; then + update-alternatives --install /usr/bin/mutt mutt /usr/bin/mutt-org 50 +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/mutt.prerm b/debian/mutt.prerm new file mode 100644 index 0000000..61b0c85 --- /dev/null +++ b/debian/mutt.prerm @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in + remove|deconfigure) + update-alternatives --remove mutt /usr/bin/mutt-org + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules index 0d6db9d..4dc943c 100755 --- a/debian/rules +++ b/debian/rules @@ -156,8 +156,11 @@ install: build grep '^set' contrib/gpg.rc; \ echo ) > debian/tmp/gpg.rc + dh_install + + # prepare files for update-alternatives + mv debian/mutt/usr/bin/mutt debian/mutt/usr/bin/mutt-org ifeq ($(BUILD_PATCHED),yes) - # temporarily call the binary mutt-patched so dh_strip gets the debug file name right install -D $(objdir)-patched/mutt debian/mutt-patched/usr/bin/mutt-patched endif @@ -168,7 +171,6 @@ endif binary binary-arch: install ###################### binary ###################### - dh_install dh_installman dh_installmenu dh_installmime @@ -180,9 +182,6 @@ binary binary-arch: install dh_strip --dbg-package=mutt-dbg rm -rf $(CURDIR)/debian/mutt-dbg/usr/share/doc/mutt-dbg \ $(CURDIR)/debian/mutt-patched/usr/share/doc/mutt-patched -ifeq ($(BUILD_PATCHED),yes) - mv debian/mutt-patched/usr/bin/mutt-patched debian/mutt-patched/usr/bin/mutt -endif dh_link dh_compress --exclude usr/share/doc/mutt/README.Patches -- 2.43.0