8cb20a6746cf52f1ee98f1d639e83099cab71121
[mirror/userdir-ldap.git] / debian / postinst
1 #! /bin/bash -e
2 #
3 # Debian postinst script for Python hierarchical modules
4 # Written by Gregor Hoffleit <flight@debian.org>
5 #
6
7 PYTHON_VER="2.4"
8 DIRLIST="/usr/lib/python$PYTHON_VER/site-packages"
9
10 case "$1" in
11     configure|abort-upgrade|abort-remove|abort-deconfigure)
12         for i in $DIRLIST ; do
13             python -O /usr/lib/python$PYTHON_VER/compileall.py -q $i
14             python /usr/lib/python$PYTHON_VER/compileall.py -q $i
15         done
16     ;;
17
18     *)
19         echo "postinst called with unknown argument \`$1'" >&2
20         exit 1
21     ;;
22 esac
23
24 if [ "$1" = "configure" ]
25 then
26     test ! -f /usr/local/bin/ud-replicate || rm -f /usr/local/bin/ud-replicate
27 fi