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