From: Denis Briand Date: Wed, 30 Dec 2015 01:56:25 +0000 (+0100) Subject: Rename postinst and postrm files into abook.* X-Git-Tag: debian/0.6.1-1~9 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=beafb44f09b28acf18a2b6befd1c70dd908552dc;p=pkg%2Fabook.git Rename postinst and postrm files into abook.* --- diff --git a/debian/abook.postinst b/debian/abook.postinst new file mode 100644 index 0000000..08ca090 --- /dev/null +++ b/debian/abook.postinst @@ -0,0 +1,61 @@ +#!/bin/sh +# postinst for abook +# copyright 2003-2012 by Gerfried Fuchs +# Licenced under WTFPLv2 + +set -e + +# Source debconf library. +if [ -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule +fi + +action=$1 +if [ "${DEBCONF_RECONFIGURE}" = "1" ]; then + # workaround until reconfigure is really available + action=reconfigure +fi +version=$2 + +# if we got reinstalled after a remove, enable the config snippet again +if [ "$action" = 'configure' ] && [ -e /etc/Muttrc.d/abook.rc.removed ] && [ ! -e /etc/Muttrc.d/abook.rc ]; then + mv /etc/Muttrc.d/abook.rc.removed /etc/Muttrc.d/abook.rc || true +fi + +# fix for #394532 breakage +if grep "abook --mutt-query '%s'" /etc/Muttrc.d/abook.rc >/dev/null 2>/dev/null ; then + sed -i "s/abook --mutt-query '%s'/abook --mutt-query %s/" /etc/Muttrc.d/abook.rc +fi + +# only on new install, upgrade from < 0.5.6 or reconfigure +if dpkg --compare-versions "$version" lt "0.5.6" || [ "$action" = "reconfigure" ]; then + mutt=true + if [ -e /usr/share/debconf/confmodule ]; then + db_get abook/muttrc.d + mutt="$RET" + fi + + case "$mutt" in + true) + if [ ! -e /etc/Muttrc.d/abook.rc ] ; then + mkdir /etc/Muttrc.d 2> /dev/null || true + cat > /etc/Muttrc.d/abook.rc << EOF +set query_command="abook --mutt-query %s" +macro pager A |'abook --add-email'\n +EOF + fi + ;; + false) + rm /etc/Muttrc.d/abook.rc 2> /dev/null || true + rmdir /etc/Muttrc.d 2> /dev/null || true + ;; + esac +fi + + +# menu entry +if [ "$action" = 'configure' ] && [ -x "`which update-menus`" ]; then + update-menus +fi + +#DEBHELPER# diff --git a/debian/abook.postrm b/debian/abook.postrm new file mode 100644 index 0000000..fece21f --- /dev/null +++ b/debian/abook.postrm @@ -0,0 +1,33 @@ +#!/bin/sh +# postrm for abook +# copyright 2003-2012 by Gerfried Fuchs +# Licenced under WTFPLv2 + +set -e + +if [ -x "`which update-menus 2>/dev/null`" ]; then + update-menus +fi + +action=$1 + +case "$action" in + remove) + if [ ! -e /etc/Muttrc.d/abook.rc.removed ]; then + # only disable the config snippet + mv /etc/Muttrc.d/abook.rc /etc/Muttrc.d/abook.rc.removed || true + fi + ;; + purge) + rm /etc/Muttrc.d/abook.rc.removed 2> /dev/null || true + rm /etc/Muttrc.d/abook.rc 2> /dev/null || true + rmdir /etc/Muttrc.d 2> /dev/null || true + # remove debconf data on purge + if [ -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_purge + fi + ;; +esac + +#DEBHELPER# diff --git a/debian/changelog b/debian/changelog index 69ac650..6a67b6b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,7 @@ abook (0.6.1-1) unstable; urgency=medium * Remove merged patch 03_datafile-f-switch. * Provide debugging symbols with a new abook-dbg binary package. * Add debhelper token into maintainers scripts. + * Rename postinst and postrm files into abook.* -- Rhonda D'Vine Fri, 14 Aug 2015 11:34:47 +0200 diff --git a/debian/postinst b/debian/postinst deleted file mode 100644 index 08ca090..0000000 --- a/debian/postinst +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh -# postinst for abook -# copyright 2003-2012 by Gerfried Fuchs -# Licenced under WTFPLv2 - -set -e - -# Source debconf library. -if [ -e /usr/share/debconf/confmodule ]; then - . /usr/share/debconf/confmodule -fi - -action=$1 -if [ "${DEBCONF_RECONFIGURE}" = "1" ]; then - # workaround until reconfigure is really available - action=reconfigure -fi -version=$2 - -# if we got reinstalled after a remove, enable the config snippet again -if [ "$action" = 'configure' ] && [ -e /etc/Muttrc.d/abook.rc.removed ] && [ ! -e /etc/Muttrc.d/abook.rc ]; then - mv /etc/Muttrc.d/abook.rc.removed /etc/Muttrc.d/abook.rc || true -fi - -# fix for #394532 breakage -if grep "abook --mutt-query '%s'" /etc/Muttrc.d/abook.rc >/dev/null 2>/dev/null ; then - sed -i "s/abook --mutt-query '%s'/abook --mutt-query %s/" /etc/Muttrc.d/abook.rc -fi - -# only on new install, upgrade from < 0.5.6 or reconfigure -if dpkg --compare-versions "$version" lt "0.5.6" || [ "$action" = "reconfigure" ]; then - mutt=true - if [ -e /usr/share/debconf/confmodule ]; then - db_get abook/muttrc.d - mutt="$RET" - fi - - case "$mutt" in - true) - if [ ! -e /etc/Muttrc.d/abook.rc ] ; then - mkdir /etc/Muttrc.d 2> /dev/null || true - cat > /etc/Muttrc.d/abook.rc << EOF -set query_command="abook --mutt-query %s" -macro pager A |'abook --add-email'\n -EOF - fi - ;; - false) - rm /etc/Muttrc.d/abook.rc 2> /dev/null || true - rmdir /etc/Muttrc.d 2> /dev/null || true - ;; - esac -fi - - -# menu entry -if [ "$action" = 'configure' ] && [ -x "`which update-menus`" ]; then - update-menus -fi - -#DEBHELPER# diff --git a/debian/postrm b/debian/postrm deleted file mode 100644 index fece21f..0000000 --- a/debian/postrm +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# postrm for abook -# copyright 2003-2012 by Gerfried Fuchs -# Licenced under WTFPLv2 - -set -e - -if [ -x "`which update-menus 2>/dev/null`" ]; then - update-menus -fi - -action=$1 - -case "$action" in - remove) - if [ ! -e /etc/Muttrc.d/abook.rc.removed ]; then - # only disable the config snippet - mv /etc/Muttrc.d/abook.rc /etc/Muttrc.d/abook.rc.removed || true - fi - ;; - purge) - rm /etc/Muttrc.d/abook.rc.removed 2> /dev/null || true - rm /etc/Muttrc.d/abook.rc 2> /dev/null || true - rmdir /etc/Muttrc.d 2> /dev/null || true - # remove debconf data on purge - if [ -e /usr/share/debconf/confmodule ]; then - . /usr/share/debconf/confmodule - db_purge - fi - ;; -esac - -#DEBHELPER#