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