[Piuparts-commits] [piuparts] 01/02: scripts: handle init system switching in nodocs tests

Holger Levsen holger at moszumanska.debian.org
Thu Nov 20 13:42:35 UTC 2014


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit 26388ebaa1e1c914c41b76760725490745f85c6a
Author: Andreas Beckmann <anbe at debian.org>
Date:   Thu Nov 20 14:23:06 2014 +0100

    scripts: handle init system switching in nodocs tests
    
    reinstall packages that may be potentially removed and reinstalled
    before taking the reference snapshot
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 .../post_setup_disable_usr_share_doc                       | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/custom-scripts/scripts-no-usr-share-doc/post_setup_disable_usr_share_doc b/custom-scripts/scripts-no-usr-share-doc/post_setup_disable_usr_share_doc
index 239d23f..c8d8f01 100755
--- a/custom-scripts/scripts-no-usr-share-doc/post_setup_disable_usr_share_doc
+++ b/custom-scripts/scripts-no-usr-share-doc/post_setup_disable_usr_share_doc
@@ -14,3 +14,17 @@ cat << EOF > /etc/dpkg/dpkg.cfg.d/piuparts-path-exclude
 path-exclude=/usr/share/doc/*/*
 path-include=/usr/share/doc/*/copyright
 EOF
+
+# switching init systems forth and back will clean out /usr/share/doc
+# reinstalling the affected packages beforehand makes the files disappear
+# before the snapshot of the reference system is created
+CANDIDATES="systemd systemd-sysv sysv-rc"
+CANDIDATES=$(dpkg-query -W $CANDIDATES | awk '{ if ($2) { print $1 } }')
+if [ -n "$CANDIDATES" ]; then
+	echo "Reinstalling $(echo $CANDIDATES)..."
+	# workaround apt bug #770291 - do it one by one, not all at once
+	for package in $CANDIDATES
+	do
+		apt-get -u --reinstall install $package
+	done
+fi

-- 
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