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