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