61 kx #!/bin/sh
61 kx
61 kx # Preserve new files
61 kx install_file() {
61 kx NEW="$1"
61 kx OLD="`dirname $NEW`/`basename $NEW .new`"
61 kx # If there's no file by that name, mv it over:
61 kx if [ ! -r $OLD ]; then
61 kx mv $NEW $OLD
61 kx elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
61 kx rm $NEW
61 kx fi
61 kx # Otherwise, we leave the .new copy for the admin to consider...
61 kx }
61 kx
61 kx
61 kx # arg 1: the new package version
61 kx pre_install() {
61 kx /bin/true
61 kx }
61 kx
61 kx # arg 1: the new package version
61 kx post_install() {
61 kx /bin/true
61 kx }
61 kx
61 kx # arg 1: the new package version
61 kx # arg 2: the old package version
61 kx pre_update() {
61 kx /bin/true
61 kx }
61 kx
61 kx # arg 1: the new package version
61 kx # arg 2: the old package version
61 kx post_update() {
61 kx post_install
61 kx }
61 kx
61 kx # arg 1: the old package version
61 kx pre_remove() {
61 kx /bin/true
61 kx }
61 kx
61 kx # arg 1: the old package version
61 kx post_remove() {
61 kx /bin/true
61 kx }
61 kx
61 kx
61 kx operation=$1
61 kx shift
61 kx
61 kx $operation $*