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