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