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