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