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