Merge pull request #4554 from mwichmann/move-env-checker
[scons.git] / packaging / debian / postinst
blob6a7d3355636c90f7b40e35f18ead5558c8651be8
1 #!/bin/sh
2 set -e
3 if [ "$1" = "configure" ]; then
4 if [ -d /usr/doc -a ! -e /usr/doc/scons -a -d /usr/share/doc/scons ]; then
5 ln -sf ../share/doc/scons /usr/doc/scons
6 fi
7 fi
9 NAME=scons
10 PYTHON_VERSION=`python -V 2>&1| cut -d" " -f2 | cut -d"." -f1-2`
11 PYTHON_EXE_NAME=`which python$PYTHON_VERSION`
12 case "$1" in
13 configure|abort-upgrade|abort-remove|abort-deconfigure)
14 dpkg --listfiles $NAME | grep '\.py$' | \
15 xargs -n 1 $PYTHON_EXE_NAME -c 'import py_compile,sys;py_compile.compile(sys.argv[1])'
16 dpkg --listfiles $NAME | grep '\.py$' | \
17 xargs -n 1 $PYTHON_EXE_NAME -O -c 'import py_compile,sys;py_compile.compile(sys.argv[1])'
19 esac