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