447 kx #!/bin/sh
447 kx
447 kx # Preserve new files
447 kx install_file() {
447 kx NEW="$1"
447 kx OLD="`dirname $NEW`/`basename $NEW .new`"
447 kx # If there's no file by that name, mv it over:
447 kx if [ ! -r $OLD ]; then
447 kx mv $NEW $OLD
447 kx elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
447 kx rm $NEW
447 kx fi
447 kx # Otherwise, we leave the .new copy for the admin to consider...
447 kx }
447 kx
447 kx
447 kx # arg 1: the new package version
447 kx pre_install() {
447 kx /bin/true
447 kx }
447 kx
447 kx # arg 1: the new package version
447 kx post_install() {
447 kx #
447 kx # NOTE:
447 kx # 'install-info' can work using relative paths and we can make use build machine
447 kx # utility during installation to the some partition and use target 'install-info'
447 kx # during installation directly on the running target machine.
447 kx #
447 kx if [ -x /usr/bin/install-info ] ; then
447 kx install-info --info-dir=usr/share/info usr/share/info/gcrypt.info.gz 2>/dev/null
447 kx elif ! grep "(gcrypt)" usr/share/info/dir 1> /dev/null 2> /dev/null ; then
447 kx cat << EOF >> usr/share/info/dir
447 kx
447 kx GNU Libraries
447 kx * libgcrypt: (gcrypt). Cryptographic function library.
447 kx EOF
447 kx fi
447 kx }
447 kx
447 kx # arg 1: the new package version
447 kx # arg 2: the old package version
447 kx pre_update() {
447 kx /bin/true
447 kx }
447 kx
447 kx # arg 1: the new package version
447 kx # arg 2: the old package version
447 kx post_update() {
447 kx post_install
447 kx }
447 kx
447 kx # arg 1: the old package version
447 kx pre_remove() {
447 kx if [ -x /usr/bin/install-info ] ; then
447 kx install-info --delete --info-file=usr/share/info/gcrypt.info.gz --dir-file=usr/share/info/dir 2> /dev/null || /bin/true
447 kx fi
447 kx }
447 kx
447 kx # arg 1: the old package version
447 kx post_remove() {
447 kx /bin/true
447 kx }
447 kx
447 kx
447 kx operation=$1
447 kx shift
447 kx
447 kx $operation $*