home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / var / lib / dpkg / info / python.preinst < prev    next >
Encoding:
Text File  |  2012-05-04  |  1.8 KB  |  52 lines

  1. #! /bin/sh
  2. set -e
  3.  
  4. # remove the python alternatives before installing our own python link
  5.  
  6. update-alternatives --auto /usr/bin/python >/dev/null 2>&1 || true
  7. update-alternatives --remove python /usr/bin/python1.5 || true
  8. update-alternatives --remove python /usr/bin/python2.1 || true
  9. update-alternatives --remove python /usr/bin/python2.2 || true
  10.  
  11. [ -L /usr/share/doc/python/html ] || rm -rf /usr/share/doc/python/html
  12.  
  13. case "$1" in
  14.     upgrade)
  15.         if dpkg --compare-versions $2 lt 2.4; then
  16.         oldv=$(echo $2 | sed 's/^\(...\).*/\1/')
  17.         if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
  18.         echo "running python pre-rtupdate hooks for python2.6..."
  19.         fi
  20.         for hook in /usr/share/python/runtime.d/*.rtupdate; do
  21.         [ -x $hook ] || continue
  22.         if ! $hook pre-rtupdate python$oldv python2.6; then
  23.             hb=$(basename $hook .rtupdate)
  24.             echo >&2 "error running python pre-rtupdate hook $hb"
  25.             echo >&2 "running python failed-pre-rtupdate hook $hb"
  26.             $hook failed-pre-rtupdate python$oldv python2.6
  27.             errors=yes
  28.             break
  29.         fi
  30.         done
  31.         [ -z "$errors" ] || exit 3
  32.     fi
  33.  
  34.     # 2.4.4-5 is the first version, which adds python2.5 as supported
  35.     # version; need to run an rtinstall python2.5 in the postinst.
  36.         if dpkg --compare-versions $2 lt 2.4.4-5 && [ -x /usr/bin/python2.5 ]; then
  37.         version=$(dpkg -s python2.5-minimal | awk '/^Version:/ {print $2}')
  38.         mkdir -p /var/lib/python
  39.         echo "$version" > /var/lib/python/python2.5_already_installed
  40.     fi
  41.  
  42.     # 2.5.4-6 is the first version, which adds python2.6 as supported
  43.     # version; need to run an rtinstall python2.6 in the postinst.
  44.         if dpkg --compare-versions $2 lt 2.5.4-6 && [ -x /usr/bin/python2.6 ]; then
  45.         version=$(dpkg -s python2.6-minimal | awk '/^Version:/ {print $2}')
  46.         mkdir -p /var/lib/python
  47.         echo "$version" > /var/lib/python/python2.6_already_installed
  48.     fi
  49. esac
  50.  
  51.  
  52.