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