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