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