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