]> git.llucax.com Git - software/mutt-debian.git/commitdiff
Use update-alternatives instead of a diversion for /usr/bin/mutt.
authorChristoph Berg <myon@debian.org>
Mon, 7 Jun 2010 12:31:10 +0000 (14:31 +0200)
committerChristoph Berg <myon@debian.org>
Mon, 7 Jun 2010 12:31:10 +0000 (14:31 +0200)
debian/changelog
debian/mutt-patched.postinst [new file with mode: 0644]
debian/mutt-patched.postrm [deleted file]
debian/mutt-patched.preinst [deleted file]
debian/mutt-patched.prerm [new file with mode: 0644]
debian/mutt.postinst [new file with mode: 0644]
debian/mutt.prerm [new file with mode: 0644]
debian/rules

index 25d22c803c7b59bc0206553ee4a2284d66c18ce4..fb63205f86e49b374b0062ca3cca67c21137db7f 100644 (file)
@@ -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 <myon@debian.org>  Sun, 06 Jun 2010 12:58:59 +0200
 
diff --git a/debian/mutt-patched.postinst b/debian/mutt-patched.postinst
new file mode 100644 (file)
index 0000000..90ebb1a
--- /dev/null
@@ -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 (file)
index 39a1eec..0000000
+++ /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 (file)
index 86fce1b..0000000
+++ /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 (file)
index 0000000..7117be4
--- /dev/null
@@ -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 (file)
index 0000000..f185315
--- /dev/null
@@ -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 (file)
index 0000000..61b0c85
--- /dev/null
@@ -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
index 0d6db9d6dd5ab88261d5095b637403bf7392141c..4dc943c94f646fb3a168377fd4a1647eeda3da59 100755 (executable)
@@ -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