summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Beckmann <debian@abeckmann.de>2012-10-01 21:33:34 +0200
committerAndreas Beckmann <debian@abeckmann.de>2012-10-01 23:23:00 +0200
commit4de1bda87cb0fe504fa5b3979dc2e3c5622f2ab2 (patch)
treebdfc616a2e6adab3b924e6f05bcd68970f8d1089
parent7de67fdbdce04db75080ce98e7fd4b594b934db5 (diff)
downloadsendmail-4de1bda87cb0fe504fa5b3979dc2e3c5622f2ab2.tar.gz
cleanup /usr/share/doc/sendmail after upgrades (where possible)
-rw-r--r--debian/build/debian/libmilter-dev.preinst.in21
-rw-r--r--debian/build/debian/libmilter.preinst.in21
-rw-r--r--debian/build/debian/rmail.preinst.in21
-rw-r--r--debian/build/debian/sendmail-base.preinst.in20
-rw-r--r--debian/build/debian/sendmail-cf.preinst.in21
-rw-r--r--debian/build/debian/sendmail-doc.preinst.in33
-rw-r--r--debian/build/debian/sensible-mda.preinst.in21
-rw-r--r--debian/changelog1
8 files changed, 51 insertions, 108 deletions
diff --git a/debian/build/debian/libmilter-dev.preinst.in b/debian/build/debian/libmilter-dev.preinst.in
index 7bd69a2..ef72d54 100644
--- a/debian/build/debian/libmilter-dev.preinst.in
+++ b/debian/build/debian/libmilter-dev.preinst.in
@@ -17,23 +17,10 @@ set -e;
PACKAGE=libmilter-dev;
-case "$1" in
- upgrade)
- if dpkg --compare-versions "$2" le "8.14.4-2.1"; then
- # /usr/share/doc/$PACKAGE is a symlink to /usr/share/doc/sendmail
- rm -f @docdir@/$PACKAGE 2>/dev/null || true;
- rmdir @docdir@/sendmail 2>/dev/null || true;
- fi;
- ;;
-
- install|abort-upgrade)
- ;;
-
- *)
- echo "$PACKAGE preinst called with unknown argument \`$1'" >&2;
- exit 1;
- ;;
- esac;
+if [ -L @docdir@/$PACKAGE ]; then
+ # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail
+ rm @docdir@/$PACKAGE
+fi
#DEBHELPER#
exit 0;
diff --git a/debian/build/debian/libmilter.preinst.in b/debian/build/debian/libmilter.preinst.in
index 0193b69..d2b0668 100644
--- a/debian/build/debian/libmilter.preinst.in
+++ b/debian/build/debian/libmilter.preinst.in
@@ -17,23 +17,10 @@ set -e;
PACKAGE=libmilter@sm_libmilter_version@;
-case "$1" in
- upgrade)
- if dpkg --compare-versions "$2" le "8.14.4-2.1"; then
- # /usr/share/doc/$PACKAGE is a symlink to /usr/share/doc/sendmail
- rm -f @docdir@/$PACKAGE 2>/dev/null || true;
- rmdir @docdir@/sendmail 2>/dev/null || true;
- fi;
- ;;
-
- install|abort-upgrade)
- ;;
-
- *)
- echo "$PACKAGE preinst called with unknown argument \`$1'" >&2;
- exit 1;
- ;;
- esac;
+if [ -L @docdir@/$PACKAGE ]; then
+ # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail
+ rm @docdir@/$PACKAGE
+fi
#DEBHELPER#
exit 0;
diff --git a/debian/build/debian/rmail.preinst.in b/debian/build/debian/rmail.preinst.in
index 0105083..6494e9c 100644
--- a/debian/build/debian/rmail.preinst.in
+++ b/debian/build/debian/rmail.preinst.in
@@ -17,23 +17,10 @@ set -e;
PACKAGE=rmail;
-case "$1" in
- upgrade)
- if dpkg --compare-versions "$2" le "8.14.4-2.1"; then
- # /usr/share/doc/$PACKAGE is a symlink to /usr/share/doc/sendmail
- rm -f @docdir@/$PACKAGE 2>/dev/null || true;
- rmdir @docdir@/sendmail 2>/dev/null || true;
- fi;
- ;;
-
- install|abort-upgrade)
- ;;
-
- *)
- echo "$PACKAGE preinst called with unknown argument \`$1'" >&2;
- exit 1;
- ;;
- esac;
+if [ -L @docdir@/$PACKAGE ]; then
+ # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail
+ rm @docdir@/$PACKAGE
+fi
#DEBHELPER#
exit 0;
diff --git a/debian/build/debian/sendmail-base.preinst.in b/debian/build/debian/sendmail-base.preinst.in
index 4570039..f1eb2fa 100644
--- a/debian/build/debian/sendmail-base.preinst.in
+++ b/debian/build/debian/sendmail-base.preinst.in
@@ -17,15 +17,21 @@ set -e;
PACKAGE=sendmail-base;
+if [ -L @docdir@/$PACKAGE ]; then
+ # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail
+ rm @docdir@/$PACKAGE
+fi
+
+if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "8.14.4-2.2~"; then
+ # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail
+ rm -rf @docdir@/sendmail/examples
+ rm -f @docdir@/sendmail/Debian-specific.gz
+ rm -f @docdir@/sendmail/site.config.m4.gz
+fi
+
+
case "$1" in
upgrade)
- if dpkg --compare-versions "$2" le "8.14.4-2.1"; then
- # /usr/share/doc/$PACKAGE is a symlink to /usr/share/doc/sendmail
- rm -f @docdir@/$PACKAGE 2>/dev/null || true;
- rm -rf @docdir@/sendmail/examples 2>/dev/null || true;
- rmdir @docdir@/sendmail 2>/dev/null || true;
- fi;
-
# Prevent cronjob from running during upgrade...
if [ -f @sysconfdir@/cron.d/sendmail ]; then
echo "#preinst" > @sysconfdir@/cron.d/sendmail;
diff --git a/debian/build/debian/sendmail-cf.preinst.in b/debian/build/debian/sendmail-cf.preinst.in
index e151cd0..35503da 100644
--- a/debian/build/debian/sendmail-cf.preinst.in
+++ b/debian/build/debian/sendmail-cf.preinst.in
@@ -17,23 +17,10 @@ set -e;
PACKAGE=sendmail-cf;
-case "$1" in
- upgrade)
- if dpkg --compare-versions "$2" le "8.14.4-2.1"; then
- # /usr/share/doc/$PACKAGE is a symlink to /usr/share/doc/sendmail
- rm -f @docdir@/$PACKAGE 2>/dev/null || true;
- rmdir @docdir@/sendmail 2>/dev/null || true;
- fi;
- ;;
-
- install|abort-upgrade)
- ;;
-
- *)
- echo "$PACKAGE preinst called with unknown argument \`$1'" >&2;
- exit 1;
- ;;
- esac;
+if [ -L @docdir@/$PACKAGE ]; then
+ # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail
+ rm @docdir@/$PACKAGE
+fi
#DEBHELPER#
exit 0;
diff --git a/debian/build/debian/sendmail-doc.preinst.in b/debian/build/debian/sendmail-doc.preinst.in
index 12860e9..7334b61 100644
--- a/debian/build/debian/sendmail-doc.preinst.in
+++ b/debian/build/debian/sendmail-doc.preinst.in
@@ -17,23 +17,24 @@ set -e;
PACKAGE=sendmail-doc;
-case "$1" in
- upgrade)
- if dpkg --compare-versions "$2" le "8.14.4-2.1"; then
- # /usr/share/doc/$PACKAGE is a symlink to /usr/share/doc/sendmail
- rm -f @docdir@/$PACKAGE 2>/dev/null || true;
- rmdir @docdir@/sendmail 2>/dev/null || true;
- fi;
- ;;
+if [ -L @docdir@/$PACKAGE ]; then
+ # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail
+ rm @docdir@/$PACKAGE
+fi
- install|abort-upgrade)
- ;;
-
- *)
- echo "$PACKAGE preinst called with unknown argument \`$1'" >&2;
- exit 1;
- ;;
- esac;
+if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "8.14.4-2.2~"; then
+ # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail
+ rm -rf @docdir@/sendmail/libmilter/
+ rm -rf @docdir@/sendmail/op/
+ rm -rf @docdir@/sendmail/sendmail/
+ rm -f @docdir@/sendmail/Debian-specific.gz
+ rm -f @docdir@/sendmail/KNOWNBUGS.gz
+ rm -f @docdir@/sendmail/README.Debian.sendmail-doc
+ rm -f @docdir@/sendmail/cf.README.gz
+ rm -f @docdir@/sendmail/faq.txt.gz
+ rm -f @docdir@/sendmail/site.config.m4.gz
+ rm -f @docdir@/sendmail/smrsh.README.gz
+fi
#DEBHELPER#
exit 0;
diff --git a/debian/build/debian/sensible-mda.preinst.in b/debian/build/debian/sensible-mda.preinst.in
index 700792b..226667b 100644
--- a/debian/build/debian/sensible-mda.preinst.in
+++ b/debian/build/debian/sensible-mda.preinst.in
@@ -17,23 +17,10 @@ set -e;
PACKAGE=sensible-mda;
-case "$1" in
- upgrade)
- if dpkg --compare-versions "$2" le "8.14.4-2.1"; then
- # /usr/share/doc/$PACKAGE is a symlink to /usr/share/doc/sendmail
- rm -f @docdir@/$PACKAGE 2>/dev/null || true;
- rmdir @docdir@/sendmail 2>/dev/null || true;
- fi;
- ;;
-
- install|abort-upgrade)
- ;;
-
- *)
- echo "$PACKAGE preinst called with unknown argument \`$1'" >&2;
- exit 1;
- ;;
- esac;
+if [ -L @docdir@/$PACKAGE ]; then
+ # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail
+ rm @docdir@/$PACKAGE
+fi
#DEBHELPER#
exit 0;
diff --git a/debian/changelog b/debian/changelog
index 5f273b9..5261690 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,7 @@ sendmail (8.14.4-2.2) UNRELEASED; urgency=low
during regeneration, this is no longer picked up automatically.
* debian/rules: Add rebuild-debian-configure target.
* debian/configure.ac: Remove the deleted maintainer scripts.
+ * Cleanup /usr/share/doc/sendmail after upgrades where possible.
-- Andreas Beckmann <debian@abeckmann.de> Mon, 01 Oct 2012 20:19:07 +0200