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