#!/bin/sh
( cd usr/lib ; rm -rf libvgagl.so.1 )
( cd usr/lib ; ln -sf libvgagl.so.1.2.10 libvgagl.so.1 )
( cd usr/lib ; rm -rf libvga.so.1 )
( cd usr/lib ; ln -sf libvga.so.1.2.10 libvga.so.1 )
cd lib/incoming
for lib in * ; do # if this file is already in /lib, we won't replace it
                  # since it might be in use.
if [ ! -r ../$lib ]; then
  mv $lib ..
fi
done
cd ..
if [ -x /sbin/ldconfig ]; then # update library links
  /sbin/ldconfig .
else # no ldconfig, we must be running safely from the bootdisk.
  rm -f libc.so.5
  ln -sf libc.so.5.4.33 libc.so.5
  rm -f libm.so.5
  ln -sf libm.so.5.0.9 libm.so.5
  rm -f libcurses.so.1
  ln -sf libcurses.so.1.0.0 libcurses.so.1
  rm -f libtermcap.so.2
  ln -sf libtermcap.so.2.0.8 libtermcap.so.2
  rm -f libgdbm.so.1
  ln -sf libgdbm.so.1.7.3 libgdbm.so.1
fi
# Get rid of the /lib/incoming directory:
rm -rf incoming
cd ../usr/lib/incoming
for lib in * ; do # if this file is already in /usr/lib, we won't replace it
                  # since it might be in use.
if [ ! -r ../$lib ]; then
  mv $lib ..
fi
done
cd ..
if [ -x /sbin/ldconfig ]; then # update library links
  /sbin/ldconfig .
else # no ldconfig, we must be running safely from the bootdisk.
#  rm -f libdb.so.2
#  ln -sf libdb.so.2.0.0 libdb.so.2
#  rm -f libgdbm.so.2
#  ln -sf libgdbm.so.2.0.0 libgdbm.so.2
  rm -f libdb.so.1
  ln -sf libdb.so.1.85.4 libdb.so.1
fi
# Get rid of the /usr/lib/incoming directory:
rm -fr incoming
cd ../..
( cd usr/lib ; rm -rf libg++.so.27 )
( cd usr/lib ; ln -sf libg++.so.27.2.1 libg++.so.27 )
( cd usr/lib ; rm -rf libstdc++.so.27 )
( cd usr/lib ; ln -sf libstdc++.so.27.2.1 libstdc++.so.27 )
( cd usr/lib ; rm -rf libgdbm.so.2 )
( cd usr/lib ; ln -sf libgdbm.so.2.0.0 libgdbm.so.2 )
( cd usr/lib ; rm -rf libdb.so.2 )
( cd usr/lib ; ln -sf libdb.so.2.0.0 libdb.so.2 )
( cd lib ; rm -rf libncurses.so.3.0 )
( cd lib ; ln -sf libncurses.so.3.0.0 libncurses.so.3.0 )
( cd lib ; rm -rf libncurses.so )
( cd lib ; ln -sf libncurses.so.3.0 libncurses.so )
( cd lib ; rm -rf libncurses.so.1.9.9e )
( cd lib ; ln -sf libncurses.so.3.0.0 libncurses.so.1.9.9e )
