[Piuparts-commits] [SCM] piatti.debian.org configuration files branch, piatti, updated. 0.43-36-ga407597

Andreas Beckmann debian at abeckmann.de
Mon Feb 27 14:04:27 UTC 2012


The following commit has been merged in the piatti branch:
commit 2f3ea0f7b9770f886312706e9be19890e669e077
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Fri Feb 24 13:46:22 2012 +0100

    a post_remove script to aid debugging purge errors
    
    Add 'set -x' in the postrm scripts of $PIUPARTS_OBJECTS before
    running 'postrm purge'.
    
    This is helpful for packages failing in the purge phase to find
    the actual failing command.
    
    This is only intended for debugging purge failures and should not
    be enabled by default.  But you can easily rerun the piuparts
    command manually and add another instance of --scriptsdir to
    include this script.
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/org/piuparts.debian.org/etc/scripts-debug-purge/post_remove_postrm_set-x b/org/piuparts.debian.org/etc/scripts-debug-purge/post_remove_postrm_set-x
new file mode 100755
index 0000000..f7f3aa6
--- /dev/null
+++ b/org/piuparts.debian.org/etc/scripts-debug-purge/post_remove_postrm_set-x
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+for target in ${PIUPARTS_OBJECTS}
+do
+	pkg=${target%%=*}
+	postrm=/var/lib/dpkg/info/$pkg.postrm
+	if [ -f $postrm ]; then
+		if head -n 1 $postrm | grep -qE '/bin/(ba)?sh' ; then
+			echo "DEBUG POSTRM PURGE: enabling 'set -x' in $pkg.postrm"
+			sed -i '2 i set -x' $postrm
+		else
+			echo "Unsupported script type in $postrm:"
+			head -n 1 $postrm
+		fi
+	fi
+done

-- 
piatti.debian.org configuration files



More information about the Piuparts-commits mailing list