aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-01-19 10:07:38 -0800
committerBen Pfaff <blp@nicira.com>2012-01-24 14:35:37 -0800
commit89e949a8d824f597a13873f778699e365792c54e (patch)
tree8594b744b082a62e8819672e33bda60b0ecbaa3e
parent8051ca8bd8b6c25fc112560babb5550de4724bd2 (diff)
debian: Delete log files correctly when packages are purged.
Debian Policy 10.8 says "Log files should be removed when the package is purged (but not when it is only removed)," but the Open vSwitch packages didn't properly implement this: - The openvswitch-brcompat and openvswitch-pki packages didn't delete their log files at purge time. - The openvswitch-switch package deleted all of the log files at purge time, even those owned by openvswitch-brcompat or openvswitch-pki. This commit fixes both problems. CC: 656448@bugs.debian.org Reported-by: Andreas Beckmann <debian@abeckmann.de> Signed-off-by: Ben Pfaff <blp@nicira.com>
-rw-r--r--debian/automake.mk2
-rwxr-xr-xdebian/openvswitch-brcompat.postrm43
-rwxr-xr-xdebian/openvswitch-pki.postrm43
-rwxr-xr-xdebian/openvswitch-switch.postrm3
4 files changed, 90 insertions, 1 deletions
diff --git a/debian/automake.mk b/debian/automake.mk
index 755d7278..e18d47a2 100644
--- a/debian/automake.mk
+++ b/debian/automake.mk
@@ -10,6 +10,7 @@ EXTRA_DIST += \
debian/openvswitch-brcompat.install \
debian/openvswitch-brcompat.manpages \
debian/openvswitch-brcompat.postinst \
+ debian/openvswitch-brcompat.postrm \
debian/openvswitch-common.dirs \
debian/openvswitch-common.install \
debian/openvswitch-common.manpages \
@@ -31,6 +32,7 @@ EXTRA_DIST += \
debian/openvswitch-ipsec.init \
debian/openvswitch-ipsec.install \
debian/openvswitch-pki.postinst \
+ debian/openvswitch-pki.postrm \
debian/openvswitch-switch.README.Debian \
debian/openvswitch-switch.dirs \
debian/openvswitch-switch.init \
diff --git a/debian/openvswitch-brcompat.postrm b/debian/openvswitch-brcompat.postrm
new file mode 100755
index 00000000..e21b0029
--- /dev/null
+++ b/debian/openvswitch-brcompat.postrm
@@ -0,0 +1,43 @@
+#!/bin/sh
+# postrm script for openvswitch-brcompat
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <overwriter>
+# <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ purge)
+ rm -f /var/log/openvswitch/ovs-brcompatd.log* || true
+ ;;
+
+ remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "postrm 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
+
+
diff --git a/debian/openvswitch-pki.postrm b/debian/openvswitch-pki.postrm
new file mode 100755
index 00000000..5db4d6be
--- /dev/null
+++ b/debian/openvswitch-pki.postrm
@@ -0,0 +1,43 @@
+#!/bin/sh
+# postrm script for openvswitch-pki
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <overwriter>
+# <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ purge)
+ rm -f /var/log/openvswitch/ovs-pki.log* || true
+ ;;
+
+ remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "postrm 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
+
+
diff --git a/debian/openvswitch-switch.postrm b/debian/openvswitch-switch.postrm
index d9113389..baf37c85 100755
--- a/debian/openvswitch-switch.postrm
+++ b/debian/openvswitch-switch.postrm
@@ -24,7 +24,8 @@ case "$1" in
rm -f /etc/openvswitch/conf.db
rm -f /etc/openvswitch/.conf.db.~lock~
rm -f /etc/default/openvswitch-switch
- rm -f /var/log/openvswitch/* || true
+ rm -f /var/log/openvswitch/ovs-vswitchd.log* || true
+ rm -f /var/log/openvswitch/ovsdb-server.log* || true
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)