[Piuparts-commits] [piuparts] 03/09: post_distupgrade_base_cleanup: generalize libdbX.Y exceptions
Holger Levsen
holger at moszumanska.debian.org
Tue Jan 13 11:00:33 UTC 2015
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch develop
in repository piuparts.
commit dd78bf838df041f69f2495c890190b7dba02337a
Author: Andreas Beckmann <anbe at debian.org>
Date: Mon Jan 12 09:34:28 2015 +0100
post_distupgrade_base_cleanup: generalize libdbX.Y exceptions
Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
.../scripts/post_distupgrade_base_cleanup | 57 ++++++++++++++++++++++
custom-scripts/scripts/post_distupgrade_exceptions | 33 -------------
debian/changelog | 2 +
3 files changed, 59 insertions(+), 33 deletions(-)
diff --git a/custom-scripts/scripts/post_distupgrade_base_cleanup b/custom-scripts/scripts/post_distupgrade_base_cleanup
new file mode 100755
index 0000000..3e05346
--- /dev/null
+++ b/custom-scripts/scripts/post_distupgrade_base_cleanup
@@ -0,0 +1,57 @@
+#!/bin/sh
+set -e
+
+#
+# Remove obsolete base packages from the reference chroot.
+#
+# These packages are part of a minimal chroot in release R, but no
+# longer exist in release R+1.
+# Package dependencies will cause removal of the obsolete packages
+# during a subset of upgrade paths. Since these packages cannot be
+# reinstalled in release R+1 ensure they are always gone from the
+# final reference chroot.
+#
+
+# Only while creating the reference chroot.
+test "$PIUPARTS_PHASE" = "" || exit 0
+
+PURGE=
+
+mark_for_purge()
+{
+ pkg="$1"
+
+ # skip if the package is not installed
+ dpkg-query -s "$pkg" >/dev/null 2>&1 || return 0
+ status="$(dpkg-query -W -f '${Status}' $pkg)"
+ test "$status" != "unknown ok not-installed" || return 0
+ test "$status" != "deinstall ok config-files" || return 0
+
+ case ${PIUPARTS_OBJECTS%%=*} in
+ $pkg)
+ # keep it while testing it
+ ;;
+ *)
+ PURGE="$PURGE $pkg"
+ esac
+}
+
+
+if [ "$PIUPARTS_DISTRIBUTION" = "wheezy" ] || \
+ [ "$PIUPARTS_DISTRIBUTION" = "wheezy-proposed" ] ; then
+
+ mark_for_purge libdb4.8
+
+fi
+
+if [ "$PIUPARTS_DISTRIBUTION" = "jessie" ] || \
+ [ "$PIUPARTS_DISTRIBUTION" = "jessie-proposed" ] ; then
+
+ mark_for_purge libdb5.1
+
+fi
+
+if [ -n "$PURGE" ]; then
+ echo "Removing packages from base system:$PURGE"
+ apt-get -y remove --purge $PURGE
+fi
diff --git a/custom-scripts/scripts/post_distupgrade_exceptions b/custom-scripts/scripts/post_distupgrade_exceptions
index ebde231..437f887 100755
--- a/custom-scripts/scripts/post_distupgrade_exceptions
+++ b/custom-scripts/scripts/post_distupgrade_exceptions
@@ -5,36 +5,3 @@ log_debug() {
echo "Debug: piuparts exception for package $PIUPARTS_OBJECTS"
}
-if [ "$PIUPARTS_DISTRIBUTION" = "wheezy" ] || \
- [ "$PIUPARTS_DISTRIBUTION" = "wheezy-proposed" ] ; then
-
- # libdb4.8/squeeze is part of the minimal squeeze chroot and
- # remains installed after distupgrade even if it no longer
- # exists in wheezy
- # db4.8-util/wheezy Conflicts/Replaces libdb4.8, so ensure it
- # gets removed from the reference chroot, too
- case ${PIUPARTS_OBJECTS%%=*} in
- db4.8-util|cyrus-*-2.2|libcyrus-imap-perl22|sa-learn-cyrus)
- log_debug
- dpkg --purge libdb4.8
- ;;
- esac
-
-fi
-
-if [ "$PIUPARTS_DISTRIBUTION" = "jessie" ] || \
- [ "$PIUPARTS_DISTRIBUTION" = "jessie-proposed" ] ; then
-
- # libdb5.1/wheezy is part of the minimal wheezy chroot and
- # remains installed after distupgrade even if it no longer
- # exists in jessie
- # db5.1-util/jessie Conflicts/Replaces libdb5.1, so ensure it
- # gets removed from the reference chroot, too
- case ${PIUPARTS_OBJECTS%%=*} in
- db5.1-util)
- log_debug
- dpkg --purge libdb5.1
- ;;
- esac
-
-fi
diff --git a/debian/changelog b/debian/changelog
index 929ebbe..73e0f01 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,8 @@ piuparts (0.63) UNRELEASED; urgency=medium
- Handle Ctrl-C while downloading Packages files and flush/unreserve, too.
- Catch another exception that may happen while talking to the master.
* scripts-no-usr-share-doc: Add exception for localepurge.
+ * post_distupgrade_base_cleanup: New custom script for generalized libdbX.Y
+ exceptions.
[ Holger Levsen ]
* piuparts.conf.pejacevic: add new suite: jessie2proposed.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git
More information about the Piuparts-commits
mailing list