#!/bin/sh if [ '#ARCH#' = 'i386' ]; then pypy3 -c '' 2>/dev/null if [ $? -eq 132 ]; then echo "PyPy doesn't appear to support this CPU." >&2 echo "SSE2 is required." >&2 exit 1 fi fi set -e hook() { local action old new hook=$1 action=$2 old_v=$3 old= if [ -n "$old_v" ]; then old=pypy3_$old_v fi new_v=$4 new=pypy3_$new_v echo "running pypy3 $action hooks for $new_v" for script in /usr/lib/pypy3/runtime.d/*."$hook"; do [ -x "$script" ] || continue if ! "$script" "$action" "$old" "$new"; then echo >&2 "error running pypy3 $action hook $(basename "$script")" return 1 fi done } case "$1" in configure) if [ -n "$2" ] && dpkg --compare-versions "$2" le '7.3.7+dfsg-4'; then # Dropped a tree under cryptography, didn't clean it (#1004369) pypy3clean /usr/lib/pypy3/lib_pypy/_cffi_ssl/ find /usr/lib/pypy3/lib_pypy/_cffi_ssl/ -depth -type d -empty -delete fi pypy3compile -p pypy3 -p 'pypy3-lib:#ARCH#' 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 rtupdate "$old_version" "$new_version" || exit 4 hook rtupdate post-rtupdate "$old_version" "$new_version" || exit 5 fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 # vim:set et ts=4 sw=4: