home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / gnome-app-install.prerm < prev    next >
Encoding:
Text File  |  2009-04-30  |  1.6 KB  |  65 lines

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