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 / python-gst0.10.rtupdate < prev    next >
Encoding:
Text File  |  2007-03-20  |  790 b   |  47 lines

  1. #!/bin/sh
  2.  
  3. # this script updates symlinks to pkg-config files after a Python default
  4. # runtime change
  5.  
  6. if [ "$#" != 3 ]; then
  7.     echo "Usage: $0 {pre-rtupdate|post-rtupdate|rtupdate} <oldruntime> <newruntime>" >&2
  8.     exit 1
  9. fi
  10.  
  11. action="$1"
  12. oldruntime="$2"
  13. newruntime="$3"
  14.  
  15. this="python-gst0.10"
  16.  
  17. pc_files() {
  18.     runtime="$1"
  19.  
  20.     dpkg -L "$this" | sed -n -e "s#^/usr/lib/pkgconfig/$runtime/##p"
  21. }
  22.  
  23. case "$action" in
  24.   pre-rtupdate)
  25.   ;;
  26.   post-rtupdate)
  27.   ;;
  28.   rtupdate)
  29.     echo "Updating *.pc symlinks for $this..."
  30.  
  31.     cd /usr/lib/pkgconfig
  32.  
  33.     for f in $(pc_files $oldruntime); do
  34.         rm -f "$f"
  35.     done
  36.  
  37.     for f in $(pc_files $newruntime); do
  38.         ln -s "$newruntime/$f"
  39.     done
  40.   ;;
  41.   *)
  42.     echo "$0 called with unknown argument \`$action'" >&2
  43.     exit 0
  44.   ;;
  45. esac
  46.  
  47.