File: postinst.pyt

package info (click to toggle)
newt 0.50.17-9.6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 572 kB
  • ctags: 1,065
  • sloc: ansic: 7,315; python: 537; makefile: 402; sh: 229
file content (32 lines) | stat: -rw-r--r-- 792 bytes parent folder | download | duplicates (2)
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
#!/bin/sh 

if [ "$1" = "configure" ]; then
 if [ -d /usr/doc -a ! -e /usr/doc/__PKG__ -a -d /usr/share/doc/__PKG__ ]; then
  ln -sf ../share/doc/__PKG__ /usr/doc/__PKG__
 fi
fi

# postinst script for Debian python packages.
# Written 1998 by Gregor Hoffleit <flight@debian.org>.
# Modified 2001 by Matthias Klose <doko@debian.org>

PACKAGE=__PKG__
PV=__PYVER__
PYTHON=python$PV
DIRLIST="/usr/lib/python$PV/site-packages"

case "$1" in
    configure|abort-upgrade|abort-remove|abort-deconfigure)
        for i in $DIRLIST ; do
            /usr/bin/$PYTHON -O /usr/lib/python$PV/compileall.py -q $i
            /usr/bin/$PYTHON /usr/lib/python$PV/compileall.py -q $i
        done
    ;;

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

exit 0