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