SCons / debian / postinst

#!/bin/sh
set -e
if [ "$1" = "configure" ]; then
	if [ -d /usr/doc -a ! -e /usr/doc/scons -a -d /usr/share/doc/scons ]; then
		ln -sf ../share/doc/scons /usr/doc/scons
	fi
fi

NAME=scons
PYTHON_VERSION=`python -V 2>&1| cut -d" " -f2 | cut -d"." -f1-2`
PYTHON_EXE_NAME=`which python$PYTHON_VERSION`
case "$1" in
        configure|abort-upgrade|abort-remove|abort-deconfigure)
                dpkg --listfiles $NAME | grep '\.py$' | \
                     xargs -n 1 $PYTHON_EXE_NAME -c 'import py_compile,sys;py_compile.compile(sys.argv[1])'
                dpkg --listfiles $NAME | grep '\.py$' | \
                     xargs -n 1 $PYTHON_EXE_NAME -O -c 'import py_compile,sys;py_compile.compile(sys.argv[1])'
        ;;
esac
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.