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