From b137288170a80f490b7468b9315d23f782562568 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Tue, 25 Nov 2008 23:16:02 -0500 Subject: [PATCH] Move invirt-dev's sudoers cleanup to the prerm instead of the postinst svn path=/trunk/packages/invirt-dev/; revision=1782 --- debian/changelog | 6 ++++++ debian/invirt-dev.postinst | 3 --- debian/invirt-dev.prerm | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100755 debian/invirt-dev.prerm diff --git a/debian/changelog b/debian/changelog index ab1ea68..b39c74d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-dev (0.0.10) unstable; urgency=low + + * Clean up /etc/sudoers in the prerm instead of the postinst + + -- Evan Broder Tue, 25 Nov 2008 23:09:03 -0500 + invirt-dev (0.0.9) unstable; urgency=low * Don't add the same line a bunch of times to /etc/sudoers diff --git a/debian/invirt-dev.postinst b/debian/invirt-dev.postinst index 96725c3..f75d229 100755 --- a/debian/invirt-dev.postinst +++ b/debian/invirt-dev.postinst @@ -9,9 +9,6 @@ case "$1" in adduser --system repository addgroup --system repo - # Clean up the old sudoers block, then add it back - perl -i.bak -ne 's%^### (BEGIN|END) invirt-dev\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers - cat >>/etc/sudoers < `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + perl -i.bak -ne 's%^### (BEGIN|END) invirt-dev\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + -- 1.7.9.5