home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / var / lib / dpkg / info / python2.4-minimal.postinst < prev    next >
Encoding:
Text File  |  2006-08-25  |  1.8 KB  |  51 lines

  1. #! /bin/sh -e
  2.  
  3. if [ "$1" = configure ]; then
  4.     (
  5.     cd /usr/lib/python2.4
  6.     files=$(dpkg -L python2.4-minimal | sed -n '/\.py$/s,^/usr/lib/python2.4/,,p')
  7.     /usr/bin/python2.4 /usr/lib/python2.4/py_compile.py $files
  8.     if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then
  9.         /usr/bin/python2.4 -O /usr/lib/python2.4/py_compile.py $files
  10.     fi
  11.     )
  12.     if [ -z "$2" ] || dpkg --compare-versions "$2" lt 2.4.3-8 \
  13.         || [ -f /var/lib/python/python2.4_installed ] \
  14.         || grep -sq '^supported-versions[^#]*python2.4' /usr/share/python/debian_defaults
  15.     then
  16.     # new installation or installation of first version with hook support
  17.     if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
  18.         echo "Linking and byte-compiling packages for runtime python2.4..."
  19.     fi
  20.     version=$(dpkg -s python2.4-minimal | awk '/^Version:/ {print $2}')
  21.     for hook in /usr/share/python/runtime.d/*.rtinstall; do
  22.         [ -x $hook ] || continue
  23.         $hook rtinstall python2.4 "$2" "$version"
  24.     done
  25.     if [ -f /var/lib/python/python2.4_installed ]; then
  26.         rm -f /var/lib/python/python2.4_installed
  27.         rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null
  28.     fi
  29.     fi
  30. fi
  31.  
  32. case "$1" in
  33.     configure)
  34.         # Create empty directories in /usr/local
  35.         if [ ! -e /usr/local/lib/python2.4 ]; then
  36.             mkdir -p /usr/local/lib/python2.4 2> /dev/null || true
  37.             chmod 2775 /usr/local/lib/python2.4 2> /dev/null || true
  38.             chown root:staff /usr/local/lib/python2.4 2> /dev/null || true
  39.         fi
  40.         if [ ! -e /usr/local/lib/python2.4/site-packages ]; then
  41.             mkdir -p /usr/local/lib/python2.4/site-packages 2> /dev/null || true
  42.             chmod 2775 /usr/local/lib/python2.4/site-packages 2> /dev/null || true
  43.             chown root:staff /usr/local/lib/python2.4/site-packages 2> /dev/null || true
  44.         fi
  45.     ;;
  46. esac
  47.  
  48.  
  49.  
  50. exit 0
  51.