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