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