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