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