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