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