File: PVER.postinst.in

package info (click to toggle)
python2.5 2.5-5%2Betch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 52,452 kB
  • ctags: 96,908
  • sloc: ansic: 352,790; python: 317,047; sh: 17,465; asm: 6,564; makefile: 4,300; lisp: 3,678; perl: 3,674; xml: 894; objc: 756; sed: 2
file content (47 lines) | stat: -rw-r--r-- 1,421 bytes parent folder | download | duplicates (6)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#! /bin/sh -e
#
# postinst script for the Debian @PVER@-base package.
# Written 1998 by Gregor Hoffleit <flight@debian.org>.
#

# remove unconditionally
update-alternatives --remove python /usr/bin/python@VER@ || true

if [ "$1" = configure ]; then
    (
	cd /usr/lib/@PVER@
	files=$(dpkg -L @PVER@ | sed -n '/\.py$/s,^/usr/lib/@PVER@/,,p')
	/usr/bin/@PVER@ /usr/lib/@PVER@/py_compile.py $files
	if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then
	    /usr/bin/@PVER@ -O /usr/lib/@PVER@/py_compile.py $files
	fi
    )
fi

case "$1" in
    configure|abort-upgrade|abort-remove|abort-deconfigure)

        # Create empty directories in /usr/local
        if [ ! -e /usr/local/lib/python@VER@ ]; then
            mkdir -p /usr/local/lib/python@VER@ 2> /dev/null || true
            chmod 2775 /usr/local/lib/python@VER@ 2> /dev/null || true
            chown root:staff /usr/local/lib/python@VER@ 2> /dev/null || true
        fi
        if [ ! -e /usr/local/lib/python@VER@/site-packages ]; then
            mkdir -p /usr/local/lib/python@VER@/site-packages 2> /dev/null || true
            chmod 2775 /usr/local/lib/python@VER@/site-packages 2> /dev/null || true
            chown root:staff /usr/local/lib/python@VER@/site-packages 2> /dev/null || true
        fi
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

ldconfig

#DEBHELPER#

exit 0