home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / doc / python2.4 / sample.postinst < prev    next >
Encoding:
Text File  |  2006-08-25  |  777 b   |  32 lines

  1. #! /bin/sh -e
  2. #
  3. # postinst script for Debian python packages.
  4. # Written 1998 by Gregor Hoffleit <flight@debian.org>.
  5. # Modified 2001 by Matthias Klose <doko@debian.org>
  6.  
  7. PACKAGE=`basename $0 .postinst`
  8. PV=`dpkg --listfiles $PACKAGE | sed -n -e '/^\/usr\/lib\/python.*\//{
  9.   s,/usr/lib/python\([0-9][0-9.]*\)/.*,\1,p
  10.   q
  11. }'`
  12. PYTHON=python$PV
  13. DIRLIST="/usr/lib/python$PV/site-packages/extension"
  14.  
  15. case "$1" in
  16.     configure|abort-upgrade|abort-remove|abort-deconfigure)
  17.         for i in $DIRLIST ; do
  18.             /usr/bin/$PYTHON -O /usr/lib/python$PV/compileall.py -q $i
  19.             /usr/bin/$PYTHON /usr/lib/python$PV/compileall.py -q $i
  20.         done
  21.     ;;
  22.  
  23.     *)
  24.         echo "postinst called with unknown argument \`$1'" >&2
  25.         exit 1
  26.     ;;
  27. esac
  28.  
  29. #DEBHELPER#
  30.  
  31. exit 0
  32.