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