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