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