X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=debian%2Fpostinst;h=03a0a900cd3e7f0e1b8454a84896b513be611270;hb=a2f12f10589a04b48cafa947b645c6ec69ec2829;hp=51642f22c0b1a66476972e9b518a7c1534a8ea9a;hpb=ebce048d2bb94d717b46f34b02ed1720aaa8aaee;p=pkg%2Ft-prot.git diff --git a/debian/postinst b/debian/postinst index 51642f2..03a0a90 100644 --- a/debian/postinst +++ b/debian/postinst @@ -6,17 +6,33 @@ if [ -e /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule fi -if [ "$1" != 'configure' ]; then +if [ "$1" != 'configure' ] && [ "$1" != 'reconfigure' ]; then exit 0 fi -symlink=true -if [ -e /usr/share/debconf/confmodule ]; then - db_get t-prot/muttrc.d - symlink="$RET" +# change existing symlink from ../Muttrc.t-prot to ../t-prot/Mutrc +if [ "$2" = "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 [ "$symlink" = "true" ]; then - mkdir /etc/Muttrc.d || true - cd /etc/Muttrc.d && ln -s ../Muttrc.t-prot t-prot.rc || true +# only on new install or reconfigure +if [ "x$2" = "x" ] || [ "$1" = "reconfigure" ] || [ "${DEBCONF_RECONFIGURE}" = "1" ]; then + symlink=true + if [ -e /usr/share/debconf/confmodule ]; then + db_get t-prot/muttrc.d + symlink="$RET" + fi + + case "$symlink" in + true) + mkdir /etc/Muttrc.d 2> /dev/null || true + cd /etc/Muttrc.d && ln -sf ../t-prot/Muttrc t-prot.rc || true + ;; + false) + if [ -L /etc/Muttrc.d/t-prot.rc ]; then + rm /etc/Muttrc.d/t-prot.rc + rmdir /etc/Muttrc.d 2> /dev/null || true + fi + ;; + esac fi