448 kx #!/bin/sh
448 kx
448 kx # Preserve new files
448 kx install_file() {
448 kx NEW="$1"
448 kx OLD="`dirname $NEW`/`basename $NEW .new`"
448 kx # If there's no file by that name, mv it over:
448 kx if [ ! -r $OLD ]; then
448 kx mv $NEW $OLD
448 kx elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
448 kx rm $NEW
448 kx fi
448 kx # Otherwise, we leave the .new copy for the admin to consider...
448 kx }
448 kx
448 kx
448 kx # arg 1: the new package version
448 kx pre_install() {
448 kx /bin/true
448 kx }
448 kx
448 kx # arg 1: the new package version
448 kx post_install() {
448 kx rm -f usr/bin/32/2to3
448 kx ln -sfr usr/bin/32/2to3-3.12 usr/bin/32/2to3
448 kx
448 kx for file in idle pydoc pynche python ; do
448 kx rm -f usr/bin/32/${file}
448 kx ln -sfr usr/bin/32/${file}3 usr/bin/32/${file}
448 kx done
448 kx
448 kx rm -f usr/bin/32/python-config
448 kx ln -sfr usr/bin/32/python3-config usr/bin/32/python-config
448 kx
448 kx for file in msgfmt pygettext ; do
448 kx rm -f usr/bin/32/${file}.py
448 kx ln -sfr usr/bin/32/${file}-3.12.py usr/bin/32/${file}.py
448 kx done
448 kx }
448 kx
448 kx # arg 1: the new package version
448 kx # arg 2: the old package version
448 kx pre_update() {
448 kx /bin/true
448 kx }
448 kx
448 kx # arg 1: the new package version
448 kx # arg 2: the old package version
448 kx post_update() {
448 kx post_install
448 kx }
448 kx
448 kx # arg 1: the old package version
448 kx pre_remove() {
448 kx /bin/true
448 kx }
448 kx
448 kx # arg 1: the old package version
448 kx post_remove() {
448 kx rm -f usr/bin/32/2to3
448 kx if [ -x "usr/bin/32/2to3-2.7" ] ; then
448 kx ln -sfr usr/bin/32/2to3-2.7 usr/bin/32/2to3
448 kx fi
448 kx
448 kx for file in idle pydoc pynche python ; do
448 kx rm -f usr/bin/32/${file}
448 kx if [ -L "usr/bin/32/${file}2" ] ; then
448 kx ln -sfr usr/bin/32/${file}2 usr/bin/32/${file}
448 kx fi
448 kx done
448 kx
448 kx rm -f usr/bin/32/python-config
448 kx if [ -L "usr/bin/32/python2-config" ] ; then
448 kx ln -sfr usr/bin/32/python2-config usr/bin/32/python-config
448 kx fi
448 kx
448 kx for file in msgfmt pygettext ; do
448 kx rm -f usr/bin/32/${file}.py
448 kx if [ -L "usr/bin/32/${file}-2.7.py" ] ; then
448 kx ln -sfr usr/bin/32/${file}-2.7.py usr/bin/32/${file}.py
448 kx fi
448 kx done
448 kx }
448 kx
448 kx
448 kx operation=$1
448 kx shift
448 kx
448 kx $operation $*