[Piuparts-commits] [SCM] piuparts git repository branch, piatti.git, updated. f3d478e5f291baaf9e84d1982ca5e2e6b353a232

Andreas Beckmann debian at abeckmann.de
Sun Apr 1 08:47:41 UTC 2012


The following commit has been merged in the piatti.git 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

-- 
piuparts git repository



More information about the Piuparts-commits mailing list