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