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