1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#!/bin/sh
set -e
set_minus_x()
{
local script=$1
if [ -f $script ]; then
if head -n 1 $script | grep -qE '/bin/(ba)?sh' ; then
echo "DEBUG REMOVE: enabling 'set -x' in ${script##*/}"
sed -i '2 i set -x' $script
else
echo "Unsupported script type in $script:"
head -n 1 $script
fi
fi
}
arch=$(dpkg --print-architecture)
for target in ${PIUPARTS_OBJECTS%%=*}
do
pkg=${target}
set_minus_x /var/lib/dpkg/info/$pkg.prerm
set_minus_x /var/lib/dpkg/info/$pkg.postrm
set_minus_x /var/lib/dpkg/info/$pkg:$arch.prerm
set_minus_x /var/lib/dpkg/info/$pkg:$arch.postrm
done
|