]> git.deb.at Git - pkg/t-prot.git/blobdiff - debian/postinst
Merge branch 'upstream'
[pkg/t-prot.git] / debian / postinst
index 03a0a900cd3e7f0e1b8454a84896b513be611270..2bb6a7d2cbbbe89366dbf4a1984f5ac6b3f0a1e3 100644 (file)
@@ -6,17 +6,29 @@ if [ -e /usr/share/debconf/confmodule ]; then
        . /usr/share/debconf/confmodule
 fi
 
-if [ "$1" != 'configure' ] && [ "$1" != 'reconfigure' ]; then
+action=$1
+version=$2
+if [ "${DEBCONF_RECONFIGURE}" = "1" ]; then
+       # workaround until reconfigure is really available
+       action=reconfigure
+fi
+
+if [ "$action" != 'configure' ] && [ "$action" != 'reconfigure' ]; then
        exit 0
 fi
 
 # change existing symlink from ../Muttrc.t-prot to ../t-prot/Mutrc
-if [ "$2" = "2.1-1" ] && [ -L /etc/Muttrc.d/t-prot.rc ]; then
+if [ "$version" = "2.1-1" ] && [ -L /etc/Muttrc.d/t-prot.rc ]; then
        cd /etc/Muttrc.d && ln -sf ../t-prot/Muttrc t-prot.rc || true
 fi
 
+# if we got reinstalled after a remove, enable the config snippet again
+if [ "$action" = 'configure' ] && [ -e /etc/Muttrc.d/t-prot.rc.removed ] && [ ! -e /etc/Muttrc.d/t-prot.rc ]; then
+       mv /etc/Muttrc.d/t-prot.rc.removed /etc/Muttrc.d/t-prot.rc || true
+fi
+
 # only on new install or reconfigure
-if [ "x$2" = "x" ] || [ "$1" = "reconfigure" ] || [ "${DEBCONF_RECONFIGURE}" = "1" ]; then
+if [ "x$version" = "x" ] || [ "$action" = "reconfigure" ]; then
        symlink=true
        if [ -e /usr/share/debconf/confmodule ]; then
                db_get t-prot/muttrc.d