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