postinst is in python3.2-minimal 3.2.3-0ubuntu3.8.
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
if [ ! -f /etc/python3.2/sitecustomize.py ]; then
cat <<-EOF
# Empty sitecustomize.py to avoid a dangling symlink
EOF
fi
if [ "$1" = configure ]; then
if [ -d /usr/lib/python3.2/config ] && [ ! -h /usr/lib/python3.2/config ]; then
if rmdir /usr/lib/python3.2/config 2> /dev/null; then
ln -sf config-3.2mu /usr/lib/python3.2/config
else
echo >&2 "WARNING: non-empty directory on upgrade: /usr/lib/python3.2/config"
ls -l /usr/lib/python3.2/config
fi
fi
fi
syssite=/usr/lib/python3.2/site-packages
localsite=/usr/local/lib/python3.2/dist-packages
syslink=../../${localsite#/usr/*}
case "$1" in
configure)
# Create empty directories in /usr/local
if [ ! -e /usr/local/lib/python3.2 ]; then
mkdir -p /usr/local/lib/python3.2 2> /dev/null || true
chmod 2775 /usr/local/lib/python3.2 2> /dev/null || true
chown root:staff /usr/local/lib/python3.2 2> /dev/null || true
fi
if [ ! -e $localsite ]; then
mkdir -p $localsite 2> /dev/null || true
chmod 2775 $localsite 2> /dev/null || true
chown root:staff $localsite 2> /dev/null || true
fi
#if [ ! -h $syssite ]; then
# ln -s $syslink $syssite
#fi
if which update-binfmts >/dev/null; then
update-binfmts --import python3.2
fi
;;
esac
if [ "$1" = configure ]; then
(
files=$(dpkg -L python3.2-minimal | sed -n '/^\/usr\/lib\/python3.2\/.*\.py$/p')
python3.2 /usr/lib/python3.2/py_compile.py $files
if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then
python3.2 -O /usr/lib/python3.2/py_compile.py $files
fi
)
bc=no
#if [ -z "$2" ] || dpkg --compare-versions "$2" lt 2.5-3 \
# || [ -f /var/lib/python/python3.2_installed ]; then
# bc=yes
#fi
if ! grep -sq '^supported-versions[^#]*python3.2' /usr/share/python/debian_defaults
then
# FIXME: byte compile anyway?
bc=no
fi
if [ "$bc" = yes ]; then
# new installation or installation of first version with hook support
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "Linking and byte-compiling packages for runtime python3.2..."
fi
version=$(dpkg -s python3.2-minimal | awk '/^Version:/ {print $2}')
for hook in /usr/share/python3/runtime.d/*.rtinstall; do
[ -x $hook ] || continue
$hook rtinstall python3.2 "$2" "$version"
done
if [ -f /var/lib/python/python3.2_installed ]; then
rm -f /var/lib/python/python3.2_installed
rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null
fi
fi
fi
exit 0
|