File: python-slang.postinst

package info (click to toggle)
python-slang 0.2.0-7.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 496 kB
  • ctags: 337
  • sloc: ansic: 3,718; python: 151; sh: 97; makefile: 93
file content (29 lines) | stat: -rw-r--r-- 737 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
#! /bin/bash -e
#
# Debian prerm script for Python x.y hierarchical modules
# Written by Gregor Hoffleit <flight@debian.org>
# Extended by Matthias Klose <doko@debian.org>
#

PACKAGE=`basename $0 | sed -e 's/\.[^.]*$//'`
PV=`dpkg --listfiles $PACKAGE | sed -n -e '/^\/usr\/lib\/python.*\//{
  s,/usr/lib/python\([0-9][0-9.]*\)/.*,\1,p
  q
}'`
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$PV -O /usr/lib/python$PV/compileall.py -q $i
	    /usr/bin/python$PV /usr/lib/python$PV/compileall.py -q $i
	done
    ;;

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

#DEBHELPER#