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