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