File: python-gst0.10-dev.rtupdate

package info (click to toggle)
gst0.10-python 0.10.19-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 4,032 kB
  • ctags: 1,854
  • sloc: sh: 11,143; python: 11,084; ansic: 1,772; perl: 1,585; makefile: 559
file content (46 lines) | stat: -rw-r--r-- 790 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh

# this script updates symlinks to pkg-config files after a Python default
# runtime change

if [ "$#" != 3 ]; then
    echo "Usage: $0 {pre-rtupdate|post-rtupdate|rtupdate} <oldruntime> <newruntime>" >&2
    exit 1
fi

action="$1"
oldruntime="$2"
newruntime="$3"

this="python-gst0.10"

pc_files() {
    runtime="$1"

    dpkg -L "$this" | sed -n -e "s#^/usr/lib/pkgconfig/$runtime/##p"
}

case "$action" in
  pre-rtupdate)
  ;;
  post-rtupdate)
  ;;
  rtupdate)
    echo "Updating *.pc symlinks for $this..."

    cd /usr/lib/pkgconfig

    for f in $(pc_files $oldruntime); do
        rm -f "$f"
    done

    for f in $(pc_files $newruntime); do
        ln -s "$newruntime/$f"
    done
  ;;
  *)
    echo "$0 called with unknown argument \`$action'" >&2
    exit 0
  ;;
esac