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