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