diff options
author | Andreas Beckmann <anbe@debian.org> | 2014-02-15 19:57:45 +0100 |
---|---|---|
committer | Andreas Beckmann <anbe@debian.org> | 2014-02-15 19:57:45 +0100 |
commit | 60cf633d672c0a3f693528b243e887b72bee4292 (patch) | |
tree | 92c9b842390ff50f9b08b759084beeb06b11b269 | |
parent | cd833c7b1a8d219166467dc18ab81e7d5456adaa (diff) | |
download | sendmail-60cf633d672c0a3f693528b243e887b72bee4292.tar.gz |
remove maintainer script boilerplate comments and code
-rw-r--r-- | debian/sendmail-base.postinst.in | 51 | ||||
-rw-r--r-- | debian/sendmail-base.postrm.in | 57 | ||||
-rw-r--r-- | debian/sendmail-base.preinst.in | 32 | ||||
-rw-r--r-- | debian/sendmail-base.prerm.in | 63 | ||||
-rw-r--r-- | debian/sendmail-bin.postinst.in | 28 | ||||
-rw-r--r-- | debian/sendmail-bin.postrm.in | 61 | ||||
-rw-r--r-- | debian/sendmail-bin.preinst.in | 36 | ||||
-rw-r--r-- | debian/sendmail-bin.prerm.in | 64 | ||||
-rw-r--r-- | debian/sendmail-cf.postrm.in | 49 |
9 files changed, 32 insertions, 409 deletions
diff --git a/debian/sendmail-base.postinst.in b/debian/sendmail-base.postinst.in index 769e441..568a6b6 100644 --- a/debian/sendmail-base.postinst.in +++ b/debian/sendmail-base.postinst.in @@ -1,29 +1,4 @@ -#!/bin/sh -e -# -# Debian post installation script -# -# Install of already installed package: -# 1) old-prerm upgrade new-version -# *) new-prerm failed-upgrade old-version -# *) old-postinst abort-upgrade new-version -# -# If a `conflicting' package is being removed at the same time: -# 1) forall packages depending on conflicting package and --auto-deconfigure -# deconfigured's-prerm deconfigure \ -# in-favour package-being-installed version \ -# removing conflicting-package version -# *) deconfigured's-postinst abort-deconfigure \ -# in-favour package-being-installed-but-failed version \ -# removing conflicting-package version -# 2) To prepare for removal of the conflicting package -# conflictor's-prerm remove \ -# in-favour package new-version -# *) conflictor's-postinst abort-remove \ -# in-favour package new-version -# -# Configuration of package: -# postinst configure most-recently-configured-version -# +#!/bin/sh set -e; PACKAGE=sendmail-base; @@ -37,15 +12,7 @@ else DEBCONF=''; fi; -case "$1" in - configure) - #----------------------------------------------------------- - if [ "$2" = "" ]; then - :; - #echo " "; - #echo "A new sendmail user, welcome!"; - fi; - +if [ "$1" = "configure" ]; then #----------------------------------------------------------- # Tell users about new and interesting things... if [ -x @datadir@/sendmail/update_notices ]; then @@ -99,18 +66,6 @@ case "$1" in "smtps\tstream\ttcp\tnowait\troot\t@sbindir@/sendmail sendmail -Am -bs"; update-inetd --group MAIL --multi --disable smtp,smtps,submission; fi; - - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - exit 0; - ;; - - *) - echo "$PACKAGE postinst called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; +fi #DEBHELPER# -exit 0; diff --git a/debian/sendmail-base.postrm.in b/debian/sendmail-base.postrm.in index fe0b535..76d134e 100644 --- a/debian/sendmail-base.postrm.in +++ b/debian/sendmail-base.postrm.in @@ -1,46 +1,17 @@ -#!/bin/sh -e -# -# Debian post removal script -# -# Install of already installed package: -# 1) Upgrade of package: -# new-preinst upgrade old-version -# *) new-postrm abort-upgrade old-version -# 2) package had some configuration files from a previous version installed -# new-preinst install old-version -# *) new-postrm abort-install old-version -# 3) Otherwise (i.e., the package was completely purged) -# new-preinst install -# *) new-postrm abort-install -# -# Removal of a package: -# 1) prerm remove -# 2) The package's files are removed (except conffiles). -# 3) postrm remove -# 4) All the maintainer scripts except the postrm are removed. -# 5) The conffiles and any backup files -# (~-files, #*# files, %-files, .dpkg-{old,new,tmp}, etc.) are removed. -# 6) postrm purge -# 7) The package's file list is removed -# +#!/bin/sh set -e; PACKAGE=sendmail-base; -case "$1" in - remove) - if [ ! -z "$2" ]; then - echo "Removing $PACKAGE $2 $3($4)"; - fi; - +if [ "$1" = "remove" ]; then if [ -x /usr/sbin/update-inetd ]; then update-inetd --remove "^smtp"; update-inetd --remove "^smtps"; update-inetd --remove "^submission"; fi; - ;; +fi - purge) +if [ "$1" = "purge" ]; then # Currently, dh_installdebconf doesn't do db_stop... ensure it is done! if [ "$1" = "purge" ] && [ -e /usr/share/debconf/confmodule ]; then # Source debconf library. @@ -81,24 +52,6 @@ case "$1" in @sysconfdir@/mail/default-auth-info \ @sysconfdir@/mail/access \ ; +fi - ;; - - upgrade) - ;; - - failed-upgrade|abort-install|abort-upgrade|disappear) - echo "$1 of $PACKAGE $2"; - ;; - - *) - echo "$PACKAGE postrm called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; - -# NOTE WELL: If we fall through here during purge, update-rc.d will be -# called with remove... and /etc/init.d/$PACKAGE goes away! #DEBHELPER# - -exit 0; diff --git a/debian/sendmail-base.preinst.in b/debian/sendmail-base.preinst.in index 1091ddc..b61d8a1 100644 --- a/debian/sendmail-base.preinst.in +++ b/debian/sendmail-base.preinst.in @@ -1,18 +1,4 @@ -#!/bin/sh -e -# -# Debian pre install script -# -# Install of already installed package: -# 1) Upgrade of package: -# new-preinst upgrade old-version -# *) new-postrm abort-upgrade old-version -# 2) package had some configuration files from a previous version installed -# new-preinst install old-version -# *) new-postrm abort-install old-version -# 3) Otherwise (i.e., the package was completely purged) -# new-preinst install -# *) new-postrm abort-install -# +#!/bin/sh set -e; PACKAGE=sendmail-base; @@ -32,9 +18,7 @@ if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "8.14.4-2.2~"; then rm -f @docdir@/sendmail/site.config.m4.gz fi - -case "$1" in - upgrade) +if [ "$1" = "upgrade" ]; then # Prevent cronjob from running during upgrade... if [ -f @sysconfdir@/cron.d/sendmail ]; then echo "#preinst" > @sysconfdir@/cron.d/sendmail; @@ -44,16 +28,6 @@ case "$1" in if [ -d @sysconfdir@/mail/ssl ]; then mv -f @sysconfdir@/mail/ssl @sysconfdir@/mail/tls; fi; - ;; - - install|abort-upgrade) - ;; - - *) - echo "$PACKAGE preinst called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; +fi #DEBHELPER# -exit 0; diff --git a/debian/sendmail-base.prerm.in b/debian/sendmail-base.prerm.in index 28941ad..f3e985b 100644 --- a/debian/sendmail-base.prerm.in +++ b/debian/sendmail-base.prerm.in @@ -1,42 +1,9 @@ -#!/bin/sh -e -# -# Debian pre removal script -# -# Install of already installed package: -# 1) old-prerm upgrade new-version -# *) new-prerm failed-upgrade old-version -# *) old-postinst abort-upgrade new-version -# -# If a `conflicting' package is being removed at the same time: -# 1) forall packages depending on conflicting package and --auto-deconfigure -# deconfigured's-prerm deconfigure \ -# in-favour package-being-installed version \ -# removing conflicting-package version -# *) deconfigured's-postinst abort-deconfigure \ -# in-favour package-being-installed-but-failed version \ -# removing conflicting-package version -# 2) To prepare for removal of the conflicting package -# conflictor's-prerm remove \ -# in-favour package new-version -# *) conflictor's-postinst abort-remove \ -# in-favour package new-version -# -# Removal of a package: -# 1) prerm remove -# 2) The package's files are removed (except conffiles). -# 3) postrm remove -# 4) All the maintainer scripts except the postrm are removed. -# +#!/bin/sh set -e; PACKAGE=sendmail-base; -case "$1" in - remove) - if [ ! -z "$2" ]; then - echo "Removing $PACKAGE $2 $3($4)"; - fi; - +if [ "$1" = "remove" ]; then if [ -x /usr/sbin/update-inetd ]; then update-inetd --group MAIL --disable smtp,smtps,submission; fi; @@ -101,9 +68,9 @@ case "$1" in # Remove empty files (probably touched databases) find @sysconfdir@/mail -maxdepth 1 -size 0 | xargs -r rm; - ;; +fi - upgrade) +if [ "$1" = "upgrade" ]; then # Potentially move the old configuration file to the new name - # before it gets deleted (for not existing in the new package) mv -f @sysconfdir@/default/sendmail \ @@ -113,26 +80,6 @@ case "$1" in if [ -f /etc/cron.d/sendmail ]; then echo "#prerm" > @sysconfdir@/cron.d/sendmail; fi; - ;; - - failed-upgrade) - ;; - - deconfigure) - echo "Deconfigure of $PACKAGE $2 $3($4) $5 $6($7) "; - ;; - - *) - echo "$PACKAGE prerm called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; - -# The @DEBHELPER@ stuff causes problems with upgrades because of the -# length of time that Sendmail is stopped... +fi -# -# Included for sanity checks -# #DEBHELPER# -exit 0; diff --git a/debian/sendmail-bin.postinst.in b/debian/sendmail-bin.postinst.in index f2ad93e..0946718 100644 --- a/debian/sendmail-bin.postinst.in +++ b/debian/sendmail-bin.postinst.in @@ -1,29 +1,4 @@ -#!/bin/sh -e -# -# Debian post installation script -# -# Install of already installed package: -# 1) old-prerm upgrade new-version -# *) new-prerm failed-upgrade old-version -# *) old-postinst abort-upgrade new-version -# -# If a `conflicting' package is being removed at the same time: -# 1) forall packages depending on conflicting package and --auto-deconfigure -# deconfigured's-prerm deconfigure \ -# in-favour package-being-installed version \ -# removing conflicting-package version -# *) deconfigured's-postinst abort-deconfigure \ -# in-favour package-being-installed-but-failed version \ -# removing conflicting-package version -# 2) To prepare for removal of the conflicting package -# conflictor's-prerm remove \ -# in-favour package new-version -# *) conflictor's-postinst abort-remove \ -# in-favour package new-version -# -# Configuration of package: -# postinst configure most-recently-configured-version -# +#!/bin/sh set -e; PACKAGE=sendmail-bin; @@ -317,4 +292,3 @@ exit 0; # # List herein (for reference) what debhelper would've done: #DEBHELPER# -exit 0; diff --git a/debian/sendmail-bin.postrm.in b/debian/sendmail-bin.postrm.in index 4fafe4e..92385b7 100644 --- a/debian/sendmail-bin.postrm.in +++ b/debian/sendmail-bin.postrm.in @@ -1,45 +1,9 @@ -#!/bin/sh -e -# -# Debian post removal script -# -# Install of already installed package: -# 1) Upgrade of package: -# new-preinst upgrade old-version -# *) new-postrm abort-upgrade old-version -# 2) package had some configuration files from a previous version installed -# new-preinst install old-version -# *) new-postrm abort-install old-version -# 3) Otherwise (i.e., the package was completely purged) -# new-preinst install -# *) new-postrm abort-install -# -# Removal of a package: -# 1) prerm remove -# 2) The package's files are removed (except conffiles). -# 3) postrm remove -# 4) All the maintainer scripts except the postrm are removed. -# 5) The conffiles and any backup files -# (~-files, #*# files, %-files, .dpkg-{old,new,tmp}, etc.) are removed. -# 6) postrm purge -# 7) The package's file list is removed -# +#!/bin/sh set -e; PACKAGE=sendmail-bin; -case "$1" in - remove) - if [ ! -z "$2" ]; then - echo "Removing $PACKAGE $2 $3($4)"; - if [ "$PACKAGE" = 'sendmail' ] && [ "$3" = 'sendmail-tls' ] || \ - [ "$PACKAGE" = 'sendmail-tls' ] && [ "$3" = 'sendmail' ]; then - echo '...Nothing to do...'; - exit 0; - fi; - fi; - ;; - - purge) +if [ "$1" = "purge" ]; then # If postrm is called *AND* there are no files, exit quickly # (This is a *GROSS* hack... beter use the test below) #if [ ! -s `echo "$0" | sed -e 's/postrm$/list/'` ]; then @@ -55,7 +19,7 @@ case "$1" in fi; # Currently, dh_installdebconf doesn't do db_stop... ensure it is done! - if [ "$1" = "purge" ] && [ -e /usr/share/debconf/confmodule ]; then + if [ -e /usr/share/debconf/confmodule ]; then # Source debconf library. . /usr/share/debconf/confmodule; # Make sure we're done @@ -66,23 +30,6 @@ case "$1" in rm -f @sysconfdir@/mail/sendmail.cf.old rm -f @sysconfdir@/mail/submit.cf.old - ;; - - upgrade) - ;; +fi - failed-upgrade|abort-install|abort-upgrade|disappear) - echo "$1 of $PACKAGE $2"; - ;; - - *) - echo "$PACKAGE postrm called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; - -# NOTE WELL: If we fall through here during purge, update-rc.d will be -# called with remove... and /etc/init.d/$PACKAGE goes away! #DEBHELPER# - -exit 0; diff --git a/debian/sendmail-bin.preinst.in b/debian/sendmail-bin.preinst.in index b45a775..b245a3b 100644 --- a/debian/sendmail-bin.preinst.in +++ b/debian/sendmail-bin.preinst.in @@ -1,22 +1,6 @@ -#!/bin/sh -e -# -# Debian pre install script -# -# Install of already installed package: -# 1) Upgrade of package: -# new-preinst upgrade old-version -# *) new-postrm abort-upgrade old-version -# 2) package had some configuration files from a previous version installed -# new-preinst install old-version -# *) new-postrm abort-install old-version -# 3) Otherwise (i.e., the package was completely purged) -# new-preinst install -# *) new-postrm abort-install -# +#!/bin/sh set -e; -PACKAGE=sendmail-bin; - # do we have debconf? if [ -f /usr/share/debconf/confmodule ]; then DEBCONF=true; @@ -25,11 +9,7 @@ else DEBCONF=''; fi; -case "$1" in - install) - ;; - - upgrade) +if [ "$1" = "upgrade" ]; then # DPKG doesn't overwrite directories with symlinks... rm -rf @libdir@/sendmail 2>/dev/null || true; @@ -37,16 +17,6 @@ case "$1" in if [ -f /etc/cron.d/sendmail ]; then echo "#preinst" > @sysconfdir@/cron.d/sendmail; fi; - ;; - - abort-upgrade) - ;; - - *) - echo "$PACKAGE preinst called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; +fi #DEBHELPER# -exit 0; diff --git a/debian/sendmail-bin.prerm.in b/debian/sendmail-bin.prerm.in index 4ce25c9..0e54e51 100644 --- a/debian/sendmail-bin.prerm.in +++ b/debian/sendmail-bin.prerm.in @@ -1,46 +1,9 @@ -#!/bin/sh -e -# -# Debian pre removal script -# -# Install of already installed package: -# 1) old-prerm upgrade new-version -# *) new-prerm failed-upgrade old-version -# *) old-postinst abort-upgrade new-version -# -# If a `conflicting' package is being removed at the same time: -# 1) forall packages depending on conflicting package and --auto-deconfigure -# deconfigured's-prerm deconfigure \ -# in-favour package-being-installed version \ -# removing conflicting-package version -# *) deconfigured's-postinst abort-deconfigure \ -# in-favour package-being-installed-but-failed version \ -# removing conflicting-package version -# 2) To prepare for removal of the conflicting package -# conflictor's-prerm remove \ -# in-favour package new-version -# *) conflictor's-postinst abort-remove \ -# in-favour package new-version -# -# Removal of a package: -# 1) prerm remove -# 2) The package's files are removed (except conffiles). -# 3) postrm remove -# 4) All the maintainer scripts except the postrm are removed. -# +#!/bin/sh set -e; PACKAGE=sendmail-bin; -case "$1" in - remove) - if [ ! -z "$2" ]; then - echo "Removing $PACKAGE $2 $3($4)"; - if [ "$PACKAGE" = 'sendmail' ] && [ "$3" = 'sendmail-tls' ] || \ - [ "$PACKAGE" = 'sendmail-tls' ] && [ "$3" = 'sendmail' ]; then - echo '...Nothing to do...'; - exit 0; - fi; - fi; +if [ "$1" = "remove" ]; then # Remove alternatives for MTA, MSP update-alternatives --remove sendmail-mta @libexecdir@/sendmail; update-alternatives --remove sendmail-msp @libexecdir@/sendmail; @@ -56,9 +19,9 @@ case "$1" in if [ -f /etc/cron.d/sendmail ]; then rm -f @sysconfdir@/cron.d/sendmail; fi; - ;; +fi - upgrade) +if [ "$1" = "upgrade" ]; then # Prevent cronjob from running during upgrade... if [ -f /etc/cron.d/sendmail ]; then echo "#prerm" > @sysconfdir@/cron.d/sendmail; @@ -68,23 +31,6 @@ case "$1" in # If we fall through to DEBHELPER, sendmail will be stopped # much earlier than necessary !!! exit 0; - ;; - - failed-upgrade) - ;; - - deconfigure) - echo "Deconfigure of $PACKAGE $2 $3($4) $5 $6($7) "; - ;; - - *) - echo "$PACKAGE prerm called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; +fi -# -# Included for sanity checks -# #DEBHELPER# -exit 0; diff --git a/debian/sendmail-cf.postrm.in b/debian/sendmail-cf.postrm.in index 606ec49..96c039a 100644 --- a/debian/sendmail-cf.postrm.in +++ b/debian/sendmail-cf.postrm.in @@ -1,52 +1,9 @@ -#!/bin/sh -e -# -# Debian post removal script -# -# Install of already installed package: -# 1) Upgrade of package: -# new-preinst upgrade old-version -# *) new-postrm abort-upgrade old-version -# 2) package had some configuration files from a previous version installed -# new-preinst install old-version -# *) new-postrm abort-install old-version -# 3) Otherwise (i.e., the package was completely purged) -# new-preinst install -# *) new-postrm abort-install -# -# Removal of a package: -# 1) prerm remove -# 2) The package's files are removed (except conffiles). -# 3) postrm remove -# 4) All the maintainer scripts except the postrm are removed. -# 5) The conffiles and any backup files -# (~-files, #*# files, %-files, .dpkg-{old,new,tmp}, etc.) are removed. -# 6) postrm purge -# 7) The package's file list is removed -# +#!/bin/sh set -e; -PACKAGE=sendmail-cf; - -case "$1" in - remove) +if [ "$1" = "remove" ]; then # Make sure the data directory is *clean* rm -rf @datadir@/sendmail/cf - ;; - - purge) - ;; - - upgrade) - ;; - - failed-upgrade|abort-install|abort-upgrade|disappear) - ;; - - *) - echo "$PACKAGE postrm called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; +fi #DEBHELPER# -exit 0; |