From ad0e45a097637362327ce9274ee8a42cf1a183a4 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Wed, 11 Mar 2009 20:45:40 -0700 Subject: [PATCH] Remove the postinst and prerm scripts doc-base registration is now handled by triggers and no longer required and removal of /usr/doc links was completed long ago. --- debian/changelog | 3 ++ debian/postinst.in | 90 ---------------------------------------------- debian/prerm.in | 78 ---------------------------------------- debian/rules | 4 --- 4 files changed, 3 insertions(+), 172 deletions(-) delete mode 100644 debian/postinst.in delete mode 100644 debian/prerm.in diff --git a/debian/changelog b/debian/changelog index 220c47b..4105acd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -87,6 +87,9 @@ debian-policy (3.8.1.0) UNRELEASED; urgency=low * Build-Depend on texlive rather than tetex-extra. texlive appears to be sufficient for how Policy uses debiandoc-sgml and pulls in far fewer packages. + * Remove the postinst and prerm scripts. doc-base registration is now + handled by triggers and no longer required and removal of /usr/doc + links was completed long ago. -- Russ Allbery Mon, 23 Jun 2008 19:23:50 -0700 diff --git a/debian/postinst.in b/debian/postinst.in deleted file mode 100644 index 6462b64..0000000 --- a/debian/postinst.in +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/sh - -# Abort if any command returns an error value -set -e - -# This is filled in by debian/rules -PACKAGE=#PACKAGE# - -# This script is called as the last step of the installation of the -# package. All the package's files are in place, dpkg has already done -# its automatic conffile handling, and all the packages we depend of -# are already fully installed and configured. - -package_name=#PACKAGE# - -if [ -z "package_name" ]; then - print >&2 "Internal Error. Please report a bug." - exit 1; -fi - -#perl -e 'print readlink("/usr/doc/'$package_name'"), "\n"; ' -case "$1" in - configure) - # Configure this package. If the package must prompt the user for - # information, do it here. - - if [ -x /usr/sbin/install-docs ]; then - /usr/sbin/install-docs -i /usr/share/doc-base/debian-policy - /usr/sbin/install-docs -i /usr/share/doc-base/debian-menu-policy - /usr/sbin/install-docs -i /usr/share/doc-base/debian-mime-policy - /usr/sbin/install-docs -i /usr/share/doc-base/debian-perl-policy - /usr/sbin/install-docs -i /usr/share/doc-base/debconf-spec - /usr/sbin/install-docs -i /usr/share/doc-base/fhs - fi - - # There are three sub-cases: - if test "${2+set}" != set; then - # We're being installed by an ancient dpkg which doesn't remember - # which version was most recently configured, or even whether - # there is a most recently configured version. - : - - elif test -z "$2" || test "$2" = ""; then - # The package has not ever been configured on this system, or was - # purged since it was last configured. - : - - else - # Version $2 is the most recently configured version of this - # package. - : - - fi - - - ;; - abort-upgrade) - # Back out of an attempt to upgrade this package FROM THIS VERSION - # to version $2. Undo the effects of "prerm upgrade $2". - : - - ;; - abort-remove) - if test "$2" != in-favour; then - echo "$0: undocumented call to \`postinst $*'" 1>&2 - exit 0 - fi - # Back out of an attempt to remove this package, which was due to - # a conflict with package $3 (version $4). Undo the effects of - # "prerm remove in-favour $3 $4". - : - - ;; - abort-deconfigure) - if test "$2" != in-favour || test "$5" != removing; then - echo "$0: undocumented call to \`postinst $*'" 1>&2 - exit 0 - fi - # Back out of an attempt to deconfigure this package, which was - # due to package $6 (version $7) which we depend on being removed - # to make way for package $3 (version $4). Undo the effects of - # "prerm deconfigure in-favour $3 $4 removing $6 $7". - : - - ;; - *) echo "$0: didn't understand being called with \`$1'" 1>&2 - exit 0;; -esac - -exit 0 diff --git a/debian/prerm.in b/debian/prerm.in deleted file mode 100644 index 6b65b55..0000000 --- a/debian/prerm.in +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh - -# Abort if any command returns an error value -set -e - -# This is filled in by debian/rules -package_name=#PACKAGE# - -# This script is called as the first step in removing the package from -# the system. This includes cases where the user explicitly asked for -# the package to be removed, upgrade, automatic removal due to conflicts, -# and deconfiguration due to temporary removal of a depended-on package. - -case "$1" in - remove) - # This package about to be removed. - : - if [ -L /usr/doc/$package_name ]; then - rm -f /usr/doc/$package_name - fi - - # There are two sub-cases: - if test "${2+set}" = set; then - if test "$2" != in-favour; then - echo "$0: undocumented call to \`prerm $*'" 1>&2 - exit 0 - fi - # We are being removed because of a conflict with package $3 - # (version $4), which is now being installed. - : - - else - # The package is being removed in its own right. - : - - fi ;; - deconfigure) - if test "$2" != in-favour || test "$5" != removing; then - echo "$0: undocumented call to \`prerm $*'" 1>&2 - exit 0 - fi - # Package $6 (version $7) which we depend on is being removed due - # to a conflict with package $3 (version $4), and this package is - # being deconfigured until $6 can be reinstalled. - : - - ;; - upgrade) - # Prepare to upgrade FROM THIS VERSION of this package to version $2. - : - if [ -L /usr/doc/$package_name ]; then - rm -f /usr/doc/$package_name - fi - - ;; - failed-upgrade) - # Prepare to upgrade from version $2 of this package TO THIS VERSION. - # This is only used if the old version's prerm couldn't handle it, - # and returned non-zero. (Fix old prerm bugs here.) - : - - ;; - *) echo "$0: didn't understand being called with \`$1'" 1>&2 - exit 0;; -esac - - - -if [ -x /usr/sbin/install-docs ]; then - /usr/sbin/install-docs -r debian-policy - /usr/sbin/install-docs -r debian-menu-policy - /usr/sbin/install-docs -r debian-mime-policy - /usr/sbin/install-docs -r debian-perl-policy - /usr/sbin/install-docs -r debconf-spec - /usr/sbin/install-docs -r fhs -fi - -exit 0 diff --git a/debian/rules b/debian/rules index c64d4b3..f3f3b76 100755 --- a/debian/rules +++ b/debian/rules @@ -143,10 +143,6 @@ stamp-policy: build $(sanitycheck) @set -ex; \ cd debian/tmp; \ find . -type f -printf '%P\0' | xargs -r0 md5sum > DEBIAN/md5sums - sed -e 's/#PACKAGE#/$(package)/g' debian/postinst.in > debian/postinst - sed -e 's/#PACKAGE#/$(package)/g' debian/prerm.in > debian/prerm - $(install_program) debian/postinst debian/tmp/DEBIAN/ - $(install_program) debian/prerm debian/tmp/DEBIAN/ dpkg-gencontrol -p$(package) -Pdebian/tmp -isp chown -R root:root debian/tmp chmod -R go=rX debian/tmp -- 2.39.5