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