home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / update-manager.prerm < prev    next >
Encoding:
Text File  |  2009-04-28  |  1.4 KB  |  53 lines

  1. #!/bin/sh
  2. set -e
  3. # Automatically added by dh_gconf
  4. if [ "$1" = remove ] || [ "$1" = upgrade ]; then
  5.     gconf-schemas --unregister update-manager.schemas 
  6. fi
  7. # End automatically added section
  8. # Automatically added by dh_pycentral
  9. case "$1" in remove|upgrade)
  10.     pkgremove=y
  11. esac
  12. if [ -f /var/lib/pycentral/update-manager.pkgremove ] || [ -f /var/lib/pycentral/pkgremove ]; then
  13.     pkgremove=y
  14. fi
  15. if [ "$pkgremove" = y ]; then
  16. if which python >/dev/null 2>&1 && which pycentral >/dev/null 2>&1; then
  17.     pycentral pkgremove update-manager
  18. else
  19.     flist=$(tempfile)
  20.     slist=$(tempfile)
  21.     dpkg -L update-manager | tee $flist | \
  22.     while read n; do
  23.       case "$n" in
  24.         /usr/share/pyshared/*)
  25.           n2=${n#/usr/share/pyshared/*}
  26.           case "$n" in
  27.         *.py) echo "p $n";;
  28.         *) [ -d "$n" ] && echo "d $n2" || echo "f $n2"
  29.           esac
  30.           ;;
  31.         *) continue
  32.       esac
  33.     done > $slist
  34.     if [ -s $slist ]; then
  35.         for d in /usr/lib/python[0-9].[0-9]/????-packages; do
  36.         case "$d" in */python2.1/*|*/python2.2/*) continue; esac
  37.         while read t n; do
  38.             case "$t" in
  39.             p) rm -f $d/$n $d/${n}[co];;
  40.             d) rmdir $d/$n 2>/dev/null || true;;
  41.             *) rm -f $d/$n
  42.             esac
  43.         done < $slist
  44.         done
  45.     fi
  46.         awk '/\/usr\/share\/pyshared/ {next} /\.py$/ {print $0"c\n" $0"o"}' $flist \
  47.         | xargs -r rm -f >&2
  48.     rm -f $flist $slist
  49. fi
  50. rm -f /var/lib/pycentral/update-manager.pkgremove
  51. fi
  52. # End automatically added section
  53.