linkchecker/debian/linkchecker.postinst
2001-04-03 19:32:11 +00:00

31 lines
883 B
Bash
Executable file

#!/bin/sh -e
#
# Written 1998 by Gregor Hoffleit <flight@debian.org>.
# used by Bastian Kleineidam for LinkChecker
SITEPACKAGES="/usr/lib/python2.0/site-packages"
DIRLIST="linkcheck"
FILELIST="_linkchecker_configdata.py"
COMMAND="'import sys,py_compile;py_compile.compile(sys.argv[1])'"
case "$1" in
configure|abort-upgrade|abort-remove|abort-deconfigure)
for i in $DIRLIST; do
python2 -O /usr/lib/python2.0/compileall.py -q $SITEPACKAGES/$i
python2 /usr/lib/python2.0/compileall.py -q $SITEPACKAGES/$i
done
# use /bin/sh -c, otherwise I get a SyntaxError from Python
for i in $FILELIST; do
/bin/sh -c "python2 -O -c $COMMAND $SITEPACKAGES/$i"
/bin/sh -c "python2 -c $COMMAND $SITEPACKAGES/$i"
done
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0