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