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