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