home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / var / lib / dpkg / info / python-minimal.postinst < prev    next >
Encoding:
Text File  |  2006-07-05  |  691 b   |  30 lines

  1. #! /bin/sh -e
  2.  
  3. new_config_file()
  4. {
  5.     cat > /etc/python/debian_config <<-EOF
  6.     [DEFAULT]
  7.     # how to byte-compile (comma separated: standard, optimize)
  8.     byte-compile = standard
  9.     EOF
  10. }
  11.  
  12. case "$1" in
  13.     configure)
  14.     [ -d /etc/python ] || mkdir /etc/python
  15.     [ -f /etc/python/debian_config ] || new_config_file
  16.  
  17.         if [ -n "$2" ] && dpkg --compare-versions $2 lt 2.4; then
  18.         oldv=$(echo $2 | sed 's/^\(...\).*/\1/')
  19.         if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
  20.         echo "byte-compiling packages for new runtime @PVER@..."
  21.         fi
  22.         for hook in /usr/share/python/runtime.d/*.rtupdate; do
  23.         [ -x $hook ] || continue
  24.         $hook rtupdate python$oldv @PVER@
  25.         done
  26.         fi
  27. esac
  28.  
  29.  
  30.