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