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