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