File: pypy.preinst.in

package info (click to toggle)
pypy 5.6.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 97,040 kB
  • ctags: 185,069
  • sloc: python: 1,147,862; ansic: 49,642; cpp: 5,245; asm: 5,169; makefile: 529; sh: 481; xml: 232; lisp: 45
file content (44 lines) | stat: -rw-r--r-- 964 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
#!/bin/sh

set -e

hook() {
    local action old new
    hook=$1
    action=$2
    old_v=$3
    new_v=$4
    old=pypy
    new=pypy
    echo "running pypy $action hooks for $new_v"
    for script in /usr/lib/pypy/runtime.d/*."$hook"; do
        [ -x "$script" ] || continue
        if ! "$script" "$action" "$old" "$new"; then
            echo >&2 "error running pypy $action hook $(basename "$script")"
            return 1
        fi
    done
}

case "$1" in
    upgrade)
        old_version=$(echo $2 | sed 's/\([[:digit:]]*\.[[:digit:]]*\).*/\1/')
        new_version=$(echo #VERSION# | sed 's/\([[:digit:]]*\.[[:digit:]]*\).*/\1/')
        if [ "$old_version" != "$new_version" ]; then
            hook rtupdate pre-rtupdate "$old_version" "$new_version" || exit 3
        fi
    ;;

    install|abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0
# vim:set et ts=4 sw=4: