58 kx #!/bin/sh
58 kx
58 kx # Preserve new files
58 kx install_file() {
58 kx NEW="$1"
58 kx OLD="`dirname $NEW`/`basename $NEW .new`"
58 kx # If there's no file by that name, mv it over:
58 kx if [ ! -r $OLD ]; then
58 kx mv $NEW $OLD
58 kx elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
58 kx rm $NEW
58 kx fi
58 kx # Otherwise, we leave the .new copy for the admin to consider...
58 kx }
58 kx
58 kx
58 kx # arg 1: the new package version
58 kx pre_install() {
58 kx /bin/true
58 kx }
58 kx
58 kx # arg 1: the new package version
58 kx post_install() {
58 kx # Notice we use an absolute path below, rather than usr/bin/update-gdk-pixbuf-loaders
58 kx # or usr/bin/update-gtk-immodules .
58 kx # Also we have to check that we are not in the installer mode on the target system
58 kx # ("/etc/system-installer"), and we have to be sure that we are on the working system
58 kx # on the target hardware ("proc/sys/kernel/osrelease" - relative path).
58 kx
58 kx if [ -r proc/sys/kernel/osrelease -a ! -r /etc/system-installer -a -x /usr/bin/gio-querymodules ]; then
58 kx /usr/bin/gio-querymodules @LIBDIR@/gio/modules 1> /dev/null 2> /dev/null
58 kx fi
58 kx }
58 kx
58 kx # arg 1: the new package version
58 kx # arg 2: the old package version
58 kx pre_update() {
58 kx /bin/true
58 kx }
58 kx
58 kx # arg 1: the new package version
58 kx # arg 2: the old package version
58 kx post_update() {
58 kx post_install
58 kx }
58 kx
58 kx # arg 1: the old package version
58 kx pre_remove() {
58 kx /bin/true
58 kx }
58 kx
58 kx # arg 1: the old package version
58 kx post_remove() {
58 kx /bin/true
58 kx }
58 kx
58 kx
58 kx operation=$1
58 kx shift
58 kx
58 kx $operation $*