5 kx #!/bin/sh
5 kx
5 kx # Preserve new files
5 kx install_file() {
5 kx NEW="$1"
5 kx OLD="`dirname $NEW`/`basename $NEW .new`"
5 kx # If there's no file by that name, mv it over:
5 kx if [ ! -r $OLD ]; then
5 kx mv $NEW $OLD
5 kx elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
5 kx rm $NEW
5 kx fi
5 kx # Otherwise, we leave the .new copy for the admin to consider...
5 kx }
5 kx
5 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() {
5 kx install_file etc/HOSTNAME.new
5 kx install_file etc/csh.login.new
5 kx install_file etc/filesystems.new
5 kx install_file etc/fstab.new
5 kx install_file etc/hosts.new
5 kx install_file etc/group.new
5 kx install_file etc/gshadow.new
5 kx install_file etc/inittab.new
5 kx install_file etc/inputrc.new
5 kx install_file etc/issue.new
5 kx install_file etc/issue.net.new
5 kx install_file etc/networks.new
5 kx install_file etc/nsswitch.conf.new
5 kx install_file etc/passwd.new
5 kx install_file etc/printcap.new
5 kx install_file etc/profile.new
5 kx install_file etc/securetty.new
5 kx install_file etc/services.new
5 kx install_file etc/shadow.new
5 kx install_file etc/shells.new
5 kx
5 kx install_file etc/profile.d/lang.csh.new
5 kx install_file etc/profile.d/lang.sh.new
5 kx
5 kx install_file etc/rc.d/rc.4.new
5 kx install_file etc/rc.d/rc.6.new
5 kx install_file etc/rc.d/rc.K.new
5 kx install_file etc/rc.d/rc.M.new
5 kx install_file etc/rc.d/rc.S.new
5 kx
5 kx install_file etc/rc.d/rc.local.new
5 kx install_file etc/rc.d/rc.local_shutdown.new
5 kx install_file etc/rc.d/rc.loop.new
5 kx install_file etc/rc.d/rc.sysvinit.new
5 kx
5 kx install_file etc/rc.d/rc.inet1.new
5 kx install_file etc/rc.d/rc.inet1.conf.new
5 kx install_file etc/rc.d/rc.inet2.new
5 kx install_file etc/rc.d/rc.wireless.new
5 kx install_file etc/rc.d/rc.wireless.conf.new
5 kx
5 kx install_file root/.cpan/CPAN/MyConfig.pm.new
5 kx install_file root/.cpan/Config.pm.new
5 kx install_file root/bin/cpan-install.new
5 kx install_file root/bin/cpan-uninstall.new
5 kx
5 kx install_file var/log/lastlog.new
5 kx
5 kx install_file etc/ld.so.conf.new
5 kx
5 kx # not fully finished stuff - depends on app/kbd, app/gpm, and kernel modules:
5 kx install_file etc/rc.d/rc.fbset.new
5 kx install_file etc/rc.d/rc.font.new
5 kx install_file etc/rc.d/rc.gpm.new
5 kx install_file etc/rc.d/rc.keymap.new
5 kx install_file etc/rc.d/rc.modules.new
5 kx install_file etc/rc.d/rc.modules.local.new
5 kx
5 kx ( cd etc/rc.d ; rm -f rc.0 )
5 kx ( cd etc/rc.d ; ln -sf rc.6 rc.0 )
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() {
5 kx ( cd etc/rc.d ; rm -f rc.0 )
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 $*