[Piuparts-commits] [SCM] piuparts git repository branch, bikeshed, updated. 0.52-50-g1ca8406
Andreas Beckmann
anbe at debian.org
Sat Jun 1 13:43:15 UTC 2013
The following commit has been merged in the bikeshed branch:
commit b1d55233b4821b3c45288990e6a5c70081aac069
Author: Andreas Beckmann <anbe at debian.org>
Date: Wed May 29 17:58:06 2013 +0200
upgrade mysql/postgresql separately
to ensure the db server is running while updating the consumers
Signed-off-by: Andreas Beckmann <anbe at debian.org>
diff --git a/custom-scripts/scripts/pre_distupgrade_zz_database-server b/custom-scripts/scripts/pre_distupgrade_zz_database-server
new file mode 100755
index 0000000..5c5ddcc
--- /dev/null
+++ b/custom-scripts/scripts/pre_distupgrade_zz_database-server
@@ -0,0 +1,27 @@
+#!/bin/sh
+set -e
+
+CANDIDATES=""
+CANDIDATES="$CANDIDATES mysql-server"
+CANDIDATES="$CANDIDATES postgresql"
+CANDIDATES="$CANDIDATES postgresql-8.4"
+CANDIDATES="$CANDIDATES postgresql-9.1"
+PACKAGES=""
+
+for pkg in $CANDIDATES
+do
+ # skip if the package is not installed
+ dpkg-query -s "$pkg" >/dev/null 2>&1 || continue
+ status="$(dpkg-query -W -f '${Status}' $pkg)"
+ test "$status" != "unknown ok not-installed" || continue
+ test "$status" != "deinstall ok config-files" || continue
+
+ PACKAGES="$PACKAGES $pkg"
+done
+
+if [ -n "$PACKAGES" ]
+then
+ echo "Upgrading ${PACKAGES# } early"
+ apt-get update
+ apt-get -y install $PACKAGES
+fi
diff --git a/debian/changelog b/debian/changelog
index 48f3f66..0204e15 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -34,6 +34,10 @@ piuparts (0.53) UNRELEASED; urgency=low
packages that require one during postinst but only recommend or suggest
(or maybe not even this) the server package to allow for remote db
servers.
+ * pre_distupgrade_zz_database-server: New script to upgrade (running)
+ database servers before all other packages. This ensures the database
+ server is running again before the dependent packages (that may declare
+ 'insufficient' dependencies on a 'local' database server) are upgraded.
[ David Steele ]
* Update python Requires to 2.7 (for argparse)
--
piuparts git repository
More information about the Piuparts-commits
mailing list