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