home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / python / runtime.d / pycentral.rtremove < prev    next >
Encoding:
Text File  |  2007-04-10  |  640 b   |  28 lines

  1. #! /bin/sh -e
  2.  
  3. cmd="$1"
  4. runtime="$2"
  5.  
  6. if which python >/dev/null 2>&1 && which pycentral >/dev/null 2>&1; then
  7.     pycentral rtremove $runtime
  8. else
  9.     flist=$(tempfile)
  10.     for pcdir in /usr/share/pycentral/*; do
  11.     pkg=$(basename $pcdir)
  12.     find /usr/share/pycentral/$pkg -depth -mindepth 2 \
  13.       \( -name '*.py' -printf 'p %P\n' -o -printf '%y %P\n' \) \
  14.       > $flist 2>&1 || true
  15.     if [ -s $flist ]; then
  16.         d=/usr/lib/$runtime
  17.         while read t n; do
  18.         case "$t" in
  19.             p) rm -f $d/$n $d/${n}[co];;
  20.             d) rmdir --ignore-fail-on-non-empty $d/$n 2>/dev/null;;
  21.             *) rm -f $d/$n
  22.         esac
  23.         done < $flist
  24.     fi
  25.     rm -f $flist
  26.     done
  27. fi
  28.