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 / python2.6-minimal.preinst < prev    next >
Encoding:
Text File  |  2010-12-26  |  2.1 KB  |  85 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. syssite=/usr/lib/python2.6/site-packages
  6. oldsite=/usr/lib/python2.6/old-site-packages
  7. localsite=/usr/local/lib/python2.6/dist-packages
  8. syslink=../../${localsite#/usr/*}
  9.  
  10. move_site_packages()
  11. {
  12.     if [ ! -d $localsite ]; then
  13.     if ! mkdir -p $localsite; then
  14.         echo >&2 "unable to create $localsite. Skip moving $syssite contents to new location"
  15.         exit 1
  16.     fi
  17.     fi
  18.  
  19.     if [ -h $syssite ]; then
  20.     :
  21.     elif [ -d $syssite ]; then
  22.     for i in $(find $syssite -mindepth 1 -maxdepth 1 -printf '%P\n'); do
  23.         echo "Moving $syssite/$i to new location:"
  24.         if [ ! -e $localsite/$i ]; then
  25.         echo "  --> $localsite/$i"
  26.         mv $syssite/$i $localsite/
  27.         elif [ ! -e $oldsite/$i ]; then
  28.         echo "  --> $oldsite/$i (already exist in $localsite/"
  29.         mv $syssite/$i $oldsite/
  30.         else
  31.         echo "  already exists in $localsite/ and $oldsite/"
  32.         echo "  please proceed manually"
  33.         exit 1
  34.         fi
  35.     done
  36.     echo "removing $syssite"
  37.     rmdir $syssite
  38.     #echo "symlinking $syssite to $localsite"
  39.     #ln -s $syslink $syssite
  40.     else
  41.     :
  42.     #ln -sf $syslink $syssite
  43.     fi
  44. }
  45.  
  46. case "$1" in
  47.     install)
  48.     # there never was a python2.6 package using site-packages.
  49.         #if [ -n "$2" ] && dpkg --compare-versions "$2" lt '2.6.1-0'; then
  50.     #    move_site_packages
  51.     #fi
  52.     if [ -z "$2" ] && [ -d $syssite ] && [ ! -h $syssite ]; then
  53.         echo "new installation of python2.6-minimal; $syssite is a directory"
  54.         echo "which is expected a symlink to $localsite."
  55.         echo "please find the package shipping files in $syssite and"
  56.         echo "file a bug report to ship these in /usr/lib/python2.6/dist-packages instead"
  57.         echo "aborting installation of python2.6-minimal"
  58.         exit 1
  59.     fi
  60.  
  61.     # remember newly installed runtime
  62.     mkdir -p /var/lib/python
  63.     touch /var/lib/python/python2.6_installed
  64.     ;;
  65.     upgrade)
  66.     # there never was a python2.6 package using site-packages.
  67.         #if [ -n "$2" ] && dpkg --compare-versions "$2" lt '2.6.1-0'; then
  68.     #    move_site_packages
  69.     #fi
  70.     :
  71.     ;;
  72.  
  73.     abort-upgrade)
  74.     ;;
  75.  
  76.     *)
  77.         echo "preinst called with unknown argument \`$1'" >&2
  78.         exit 1
  79.     ;;
  80. esac
  81.  
  82.  
  83.  
  84. exit 0
  85.