aboutsummaryrefslogtreecommitdiff
path: root/debian/zinc-python/DEBIAN/postinst
blob: 0f85b0aefde4d0758a4ae51812db52dff0f801e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/bash -e
#
# Debian postinst script for Python hierarchical modules
# Written by Gregor Hoffleit <flight@debian.org>
#

NAME=zinc-python
DEFAULT_VERSION_PYTHON=`dpkg -p python| grep -e "^Version:" |cut -d" " -f2|cut -d"." -f1-2`
DIRLIST="/usr/lib/python${DEFAULT_VERSION_PYTHON}/site-packages"

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

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