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