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