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