File: pre_remove_prerm_set-x

package info (click to toggle)
piuparts 0.62
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 1,692 kB
  • sloc: python: 6,823; sh: 2,194; makefile: 126
file content (17 lines) | stat: -rwxr-xr-x 368 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
set -e

for target in ${PIUPARTS_OBJECTS%%=*}
do
	pkg=${target}
	prerm=/var/lib/dpkg/info/$pkg.prerm
	if [ -f $prerm ]; then
		if head -n 1 $prerm | grep -qE '/bin/(ba)?sh' ; then
			echo "DEBUG PRERM REMOVE: enabling 'set -x' in $pkg.prerm"
			sed -i '2 i set -x' $prerm
		else
			echo "Unsupported script type in $prerm:"
			head -n 1 $prerm
		fi
	fi
done