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