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