postinst is in pypy 2.2.1+dfsg-1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | #!/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
}
bc_stdlib() {
pypycompile /usr/lib/pypy/lib-python /usr/lib/pypy/lib_pypy \
-X '.*/test/bad(syntax|_coding).*\.py' \
-X '.*/tests/data/py3_test_grammar\.py'
}
case "$1" in
configure)
if [ -n "$2" ] && dpkg --compare-versions "$2" le 2.2; then
# We weren't running pypyclean in prerm in versions before 2.2
pypyclean /usr/lib/pypy/lib-python /usr/lib/pypy/lib_pypy
fi
bc_stdlib
old_version=$(echo $2 | sed 's/\([[:digit:]]*\.[[:digit:]]*\).*/\1/')
new_version=$(echo 2.2.1 | sed 's/\([[:digit:]]*\.[[:digit:]]*\).*/\1/')
if [ "$old_version" != "$new_version" ]; then
hook rtupdate rtupdate "$old_version" "$new_version" || exit 4
hook rtupdate post-rtupdate "$old_version" "$new_version" || exit 5
fi
;;
triggered)
opts=""
# Has the stdlib vanished?
if find /usr/lib/pypy/lib-python -name '*.py' | grep -q '.*'; then
bc_stdlib
else
pypyclean /usr/lib/pypy/lib-python /usr/lib/pypy/lib_pypy
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# Automatically added by dh_usrlocal
if [ "$1" = configure ]; then
(
while read line; do
set -- $line
dir="$1"; mode="$2"; user="$3"; group="$4"
if [ ! -e "$dir" ]; then
if mkdir "$dir" 2>/dev/null; then
chown "$user":"$group" "$dir"
chmod "$mode" "$dir"
fi
fi
done
) << DATA
/usr/local/lib 2775 root staff
/usr/local/lib/pypy2.7 2775 root staff
/usr/local/lib/pypy2.7/dist-packages 2775 root staff
DATA
fi
# End automatically added section
exit 0
# vim:set et ts=4 sw=4:
|