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