File: postrm.disabled

package info (click to toggle)
python-central 0.6.16%2Bnmu1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 280 kB
  • ctags: 234
  • sloc: python: 2,585; perl: 522; sh: 135; makefile: 58
file content (28 lines) | stat: -rw-r--r-- 708 bytes parent folder | download | duplicates (4)
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 -e

case "$1" in remove|purge)
    # check for any files left installed, remove the bytecode and unlink

    flist=$(tempfile)
    for pcdir in /usr/share/pycentral/*; do
	pkg=$(basename $pcdir)
	find /usr/share/pycentral/$pkg -depth -mindepth 2 \
	  \( -name '*.py' -printf 'p %P\n' -o -printf '%y %P\n' \) \
	  > $flist 2>/dev/null || true
	if [ -s $flist ]; then
	    for d in /usr/lib/python[0-9].[0-9]; do
		case "$d" in */python2.1|*/python2.2) continue; esac
		while read t n; do
		    case "$t" in
			p) rm -f $d/$n $d/${n}[co];;
			d) rmdir --ignore-fail-on-non-empty $d/$n 2>/dev/null;;
			*) rm -f $d/$n
		    esac
		done < $flist
	    done
	fi
	rm -f $flist
    done
esac

#DEBHELPER#