( cd bin ; rm -rf compress )
( cd bin ; ln -sf /usr/bin/compress compress )
( cd bin ; rm -rf red )
( cd bin ; ln -sf ed red )
( cd etc ; rm -rf magic )
( cd etc ; ln -sf file/magic magic )
( cd etc ; rm -rf magic.mime )
( cd etc ; ln -sf file/magic.mime magic.mime )
( cd usr/bin ; rm -rf rpm2tgz )
( cd usr/bin ; ln -sf rpm2targz rpm2tgz )
( cd usr/bin ; rm -rf uncompress )
( cd usr/bin ; ln -sf compress uncompress )
( cd usr/bin ; rm -rf which )
( cd usr/bin ; ln -sf ../../bin/which which )
config() {
  NEW="$1"
  OLD="`dirname $NEW`/`basename $NEW .new`"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

config etc/file/magic.new
config etc/file/magic.mime.new

# Don't let an upgrade nuke someone's old /etc/magic files:
if [ -f etc/magic -a ! -L etc/magic ]; then
  mv etc/magic etc/magic.old
fi
if [ -f etc/magic.mime -a ! -L etc/magic.mime ]; then
  mv etc/magic.mime etc/magic.mime.old
fi

( cd usr/lib ; rm -rf makewhatis )
( cd usr/lib ; ln -sf /usr/sbin/makewhatis makewhatis )
( cd sbin ; rm -rf fsck.hpfs )
( cd sbin ; ln -sf /bin/true fsck.hpfs )
( cd sbin ; rm -rf fsck.msdos )
( cd sbin ; ln -sf /bin/true fsck.msdos )
( cd sbin ; rm -rf fsck.umsdos )
( cd sbin ; ln -sf /bin/true fsck.umsdos )
( cd sbin ; rm -rf mkfs.msdos )
( cd sbin ; ln -sf mkdosfs mkfs.msdos )
# Install the info files for this package
if [ -x usr/bin/install-info ]
then
   usr/bin/install-info --info-dir=/usr/info /usr/info/ed.info.gz 2>/dev/null
   usr/bin/install-info --info-dir=/usr/info /usr/info/sharutils.info.gz 2>/dev/null
   usr/bin/install-info --info-dir=/usr/info /usr/info/time.info.gz 2>/dev/null
   usr/bin/install-info --info-dir=/usr/info /usr/info/which.info.gz 2>/dev/null
fi

