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