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