#!/bin/sh
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/X11/xdm/xdm-config.new
config etc/X11/xdm/Xservers.new
config etc/X11/xdm/Xsession.new
( cd etc/X11/xdm ; rm -rf authdir )
( cd etc/X11/xdm ; ln -sf ../../../var/lib/xdm authdir )
( cd etc/X11/xkb ; rm -rf compiled )
( cd etc/X11/xkb ; ln -sf ../../../var/lib/xkb compiled )
( cd etc/X11/rstart/commands ; rm -rf x )
( cd etc/X11/rstart/commands ; ln -sf x11r6 x )
( cd etc/X11/rstart/commands ; rm -rf x11 )
( cd etc/X11/rstart/commands ; ln -sf x11r6 x11 )
( cd etc/X11/rstart/contexts ; rm -rf x )
( cd etc/X11/rstart/contexts ; ln -sf x11r6 x )
( cd etc/X11/rstart/contexts ; rm -rf x11 )
( cd etc/X11/rstart/contexts ; ln -sf x11r6 x11 )
( cd usr/lib ; rm -rf libfreetype.so )
( cd usr/lib ; ln -sf libfreetype.so.6.3.4 libfreetype.so )
( cd usr/lib ; rm -rf libGL.so.1 )
( cd usr/lib ; ln -sf /usr/X11R6/lib/libGL.so.1 libGL.so.1 )
( cd usr/lib ; rm -rf libGL.so )
( cd usr/lib ; ln -sf /usr/X11R6/lib/libGL.so libGL.so )
( cd usr/lib ; rm -rf libfreetype.so.6 )
( cd usr/lib ; ln -sf libfreetype.so.6.3.4 libfreetype.so.6 )
( cd usr/X11R6/bin ; rm -rf X )
( cd usr/X11R6/bin ; ln -sf XFree86 X )
( cd usr/X11R6/bin ; rm -rf inb )
( cd usr/X11R6/bin ; ln -sf ioport inb )
( cd usr/X11R6/bin ; rm -rf inl )
( cd usr/X11R6/bin ; ln -sf ioport inl )
( cd usr/X11R6/bin ; rm -rf inw )
( cd usr/X11R6/bin ; ln -sf ioport inw )
( cd usr/X11R6/bin ; rm -rf outb )
( cd usr/X11R6/bin ; ln -sf ioport outb )
( cd usr/X11R6/bin ; rm -rf outl )
( cd usr/X11R6/bin ; ln -sf ioport outl )
( cd usr/X11R6/bin ; rm -rf outw )
( cd usr/X11R6/bin ; ln -sf ioport outw )
( cd usr/X11R6/lib/X11 ; rm -rf fs )
( cd usr/X11R6/lib/X11 ; ln -sf ../../../../etc/X11/fs fs )
( cd usr/X11R6/lib/X11 ; rm -rf twm )
( cd usr/X11R6/lib/X11 ; ln -sf ../../../../etc/X11/twm twm )
( cd usr/X11R6/lib/X11 ; rm -rf xdm )
( cd usr/X11R6/lib/X11 ; ln -sf ../../../../etc/X11/xdm xdm )
( cd usr/X11R6/lib/X11 ; rm -rf xkb )
( cd usr/X11R6/lib/X11 ; ln -sf ../../../../etc/X11/xkb xkb )
( cd usr/X11R6/lib/X11 ; rm -rf xsm )
( cd usr/X11R6/lib/X11 ; ln -sf ../../../../etc/X11/xsm xsm )
( cd usr/X11R6/lib/X11 ; rm -rf lbxproxy )
( cd usr/X11R6/lib/X11 ; ln -sf ../../../../etc/X11/lbxproxy lbxproxy )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; rm -rf plus )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; ln -sf cross plus )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; rm -rf arrow )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; ln -sf right_ptr arrow )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; rm -rf draft_large )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; ln -sf right_ptr draft_large )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; rm -rf draft_small )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; ln -sf right_ptr draft_small )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; rm -rf crosshair )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; ln -sf cross crosshair )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; rm -rf 08e8e1c95fe2fc01f976f1e063a24ccd )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; ln -sf left_ptr_watch 08e8e1c95fe2fc01f976f1e063a24ccd )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; rm -rf cross_reverse )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; ln -sf cross cross_reverse )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; rm -rf tcross )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; ln -sf cross tcross )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; rm -rf top_left_arrow )
( cd usr/X11R6/lib/X11/icons/whiteglass/cursors ; ln -sf left_ptr top_left_arrow )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; rm -rf plus )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; ln -sf cross plus )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; rm -rf arrow )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; ln -sf right_ptr arrow )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; rm -rf draft_large )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; ln -sf right_ptr draft_large )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; rm -rf draft_small )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; ln -sf right_ptr draft_small )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; rm -rf crosshair )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; ln -sf cross crosshair )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; rm -rf 08e8e1c95fe2fc01f976f1e063a24ccd )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; ln -sf left_ptr_watch 08e8e1c95fe2fc01f976f1e063a24ccd )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; rm -rf cross_reverse )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; ln -sf cross cross_reverse )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; rm -rf tcross )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; ln -sf cross tcross )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; rm -rf top_left_arrow )
( cd usr/X11R6/lib/X11/icons/handhelds/cursors ; ln -sf left_ptr top_left_arrow )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; rm -rf plus )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; ln -sf cross plus )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; rm -rf arrow )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; ln -sf right_ptr arrow )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; rm -rf draft_large )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; ln -sf right_ptr draft_large )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; rm -rf draft_small )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; ln -sf right_ptr draft_small )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; rm -rf crosshair )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; ln -sf cross crosshair )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; rm -rf 08e8e1c95fe2fc01f976f1e063a24ccd )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; ln -sf left_ptr_watch 08e8e1c95fe2fc01f976f1e063a24ccd )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; rm -rf cross_reverse )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; ln -sf cross cross_reverse )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; rm -rf tcross )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; ln -sf cross tcross )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; rm -rf top_left_arrow )
( cd usr/X11R6/lib/X11/icons/redglass/cursors ; ln -sf left_ptr top_left_arrow )
( cd usr/X11R6/lib/X11 ; rm -rf xserver )
( cd usr/X11R6/lib/X11 ; ln -sf ../../../../etc/X11/xserver xserver )
( cd usr/X11R6/lib/X11 ; rm -rf xinit )
( cd usr/X11R6/lib/X11 ; ln -sf ../../../../etc/X11/xinit xinit )
( cd usr/X11R6/lib/X11 ; rm -rf rstart )
( cd usr/X11R6/lib/X11 ; ln -sf ../../../../etc/X11/rstart rstart )
( cd usr/X11R6/lib/X11 ; rm -rf app-defaults )
( cd usr/X11R6/lib/X11 ; ln -sf ../../../../etc/X11/app-defaults app-defaults )
( cd usr/X11R6/lib/X11 ; rm -rf proxymngr )
( cd usr/X11R6/lib/X11 ; ln -sf ../../../../etc/X11/proxymngr proxymngr )
( cd usr/X11R6/lib ; rm -rf libXext.so )
( cd usr/X11R6/lib ; ln -sf libXext.so.6.4 libXext.so )
( cd usr/X11R6/lib ; rm -rf libfontconfig.so.1 )
( cd usr/X11R6/lib ; ln -sf libfontconfig.so.1.0.4 libfontconfig.so.1 )
( cd usr/X11R6/lib ; rm -rf libXp.so.6 )
( cd usr/X11R6/lib ; ln -sf libXp.so.6.2 libXp.so.6 )
( cd usr/X11R6/lib ; rm -rf libOSMesa.so.4 )
( cd usr/X11R6/lib ; ln -sf libOSMesa.so.4.0 libOSMesa.so.4 )
( cd usr/X11R6/lib ; rm -rf libXmuu.so )
( cd usr/X11R6/lib ; ln -sf libXmuu.so.1.0 libXmuu.so )
( cd usr/X11R6/lib ; rm -rf libGL.so.1 )
( cd usr/X11R6/lib ; ln -sf libGL.so.1.2 libGL.so.1 )
( cd usr/X11R6/lib ; rm -rf libXt.so.6 )
( cd usr/X11R6/lib ; ln -sf libXt.so.6.0 libXt.so.6 )
( cd usr/X11R6/lib ; rm -rf libXv.so.1 )
( cd usr/X11R6/lib ; ln -sf libXv.so.1.0 libXv.so.1 )
( cd usr/X11R6/lib ; rm -rf libXft.so.1 )
( cd usr/X11R6/lib ; ln -sf libXft.so.1.1 libXft.so.1 )
( cd usr/X11R6/lib ; rm -rf libXft.so.2 )
( cd usr/X11R6/lib ; ln -sf libXft.so.2.1 libXft.so.2 )
( cd usr/X11R6/lib ; rm -rf libXfont.so )
( cd usr/X11R6/lib ; ln -sf libXfont.so.1.4 libXfont.so )
( cd usr/X11R6/lib ; rm -rf libXtst.so.6 )
( cd usr/X11R6/lib ; ln -sf libXtst.so.6.1 libXtst.so.6 )
( cd usr/X11R6/lib ; rm -rf libXtst.so )
( cd usr/X11R6/lib ; ln -sf libXtst.so.6.1 libXtst.so )
( cd usr/X11R6/lib ; rm -rf libXmu.so.6 )
( cd usr/X11R6/lib ; ln -sf libXmu.so.6.2 libXmu.so.6 )
( cd usr/X11R6/lib ; rm -rf libXmuu.so.1 )
( cd usr/X11R6/lib ; ln -sf libXmuu.so.1.0 libXmuu.so.1 )
( cd usr/X11R6/lib ; rm -rf libXTrap.so.6 )
( cd usr/X11R6/lib ; ln -sf libXTrap.so.6.4 libXTrap.so.6 )
( cd usr/X11R6/lib ; rm -rf libXcursor.so )
( cd usr/X11R6/lib ; ln -sf libXcursor.so.1.0 libXcursor.so )
( cd usr/X11R6/lib ; rm -rf libxrx.so )
( cd usr/X11R6/lib ; ln -sf libxrx.so.6.3 libxrx.so )
( cd usr/X11R6/lib ; rm -rf pkgconfig )
( cd usr/X11R6/lib ; ln -sf /usr/lib/pkgconfig pkgconfig )
( cd usr/X11R6/lib ; rm -rf libxrx.so.6 )
( cd usr/X11R6/lib ; ln -sf libxrx.so.6.3 libxrx.so.6 )
( cd usr/X11R6/lib ; rm -rf libXrandr.so )
( cd usr/X11R6/lib ; ln -sf libXrandr.so.2.0 libXrandr.so )
( cd usr/X11R6/lib ; rm -rf libICE.so.6 )
( cd usr/X11R6/lib ; ln -sf libICE.so.6.3 libICE.so.6 )
( cd usr/X11R6/lib ; rm -rf libXrender.so )
( cd usr/X11R6/lib ; ln -sf libXrender.so.1.2 libXrender.so )
( cd usr/X11R6/lib ; rm -rf libOSMesa.so )
( cd usr/X11R6/lib ; ln -sf libOSMesa.so.4.0 libOSMesa.so )
( cd usr/X11R6/lib ; rm -rf libXrandr.so.2 )
( cd usr/X11R6/lib ; ln -sf libXrandr.so.2.0 libXrandr.so.2 )
( cd usr/X11R6/lib ; rm -rf libfontconfig.so )
( cd usr/X11R6/lib ; ln -sf libfontconfig.so.1.0.4 libfontconfig.so )
( cd usr/X11R6/lib ; rm -rf libXaw.so.6 )
( cd usr/X11R6/lib ; ln -sf libXaw.so.6.1 libXaw.so.6 )
( cd usr/X11R6/lib ; rm -rf libXaw.so.7 )
( cd usr/X11R6/lib ; ln -sf libXaw.so.7.0 libXaw.so.7 )
( cd usr/X11R6/lib ; rm -rf libXpm.so.4 )
( cd usr/X11R6/lib ; ln -sf libXpm.so.4.11 libXpm.so.4 )
( cd usr/X11R6/lib ; rm -rf libGLU.so )
( cd usr/X11R6/lib ; ln -sf libGLU.so.1.3 libGLU.so )
( cd usr/X11R6/lib ; rm -rf libICE.so )
( cd usr/X11R6/lib ; ln -sf libICE.so.6.3 libICE.so )
( cd usr/X11R6/lib ; rm -rf libX11.so.6 )
( cd usr/X11R6/lib ; ln -sf libX11.so.6.2 libX11.so.6 )
( cd usr/X11R6/lib ; rm -rf libXTrap.so )
( cd usr/X11R6/lib ; ln -sf libXTrap.so.6.4 libXTrap.so )
( cd usr/X11R6/lib ; rm -rf libXfont.so.1 )
( cd usr/X11R6/lib ; ln -sf libXfont.so.1.4 libXfont.so.1 )
( cd usr/X11R6/lib ; rm -rf libpsres.so )
( cd usr/X11R6/lib ; ln -sf libpsres.so.1.0 libpsres.so )
( cd usr/X11R6/lib ; rm -rf libdpstk.so.1 )
( cd usr/X11R6/lib ; ln -sf libdpstk.so.1.0 libdpstk.so.1 )
( cd usr/X11R6/lib ; rm -rf libGLU.so.1 )
( cd usr/X11R6/lib ; ln -sf libGLU.so.1.3 libGLU.so.1 )
( cd usr/X11R6/lib ; rm -rf libX11.so )
( cd usr/X11R6/lib ; ln -sf libX11.so.6.2 libX11.so )
( cd usr/X11R6/lib ; rm -rf libGL.so )
( cd usr/X11R6/lib ; ln -sf libGL.so.1.2 libGL.so )
( cd usr/X11R6/lib ; rm -rf libSM.so )
( cd usr/X11R6/lib ; ln -sf libSM.so.6.0 libSM.so )
( cd usr/X11R6/lib ; rm -rf libXi.so )
( cd usr/X11R6/lib ; ln -sf libXi.so.6.0 libXi.so )
( cd usr/X11R6/lib ; rm -rf libXp.so )
( cd usr/X11R6/lib ; ln -sf libXp.so.6.2 libXp.so )
( cd usr/X11R6/lib ; rm -rf libXt.so )
( cd usr/X11R6/lib ; ln -sf libXt.so.6.0 libXt.so )
( cd usr/X11R6/lib ; rm -rf libXv.so )
( cd usr/X11R6/lib ; ln -sf libXv.so.1.0 libXv.so )
( cd usr/X11R6/lib ; rm -rf libpsres.so.1 )
( cd usr/X11R6/lib ; ln -sf libpsres.so.1.0 libpsres.so.1 )
( cd usr/X11R6/lib ; rm -rf libXaw.so )
( cd usr/X11R6/lib ; ln -sf libXaw.so.7.0 libXaw.so )
( cd usr/X11R6/lib ; rm -rf libXft.so )
( cd usr/X11R6/lib ; ln -sf libXft.so.2.1 libXft.so )
( cd usr/X11R6/lib ; rm -rf libXmu.so )
( cd usr/X11R6/lib ; ln -sf libXmu.so.6.2 libXmu.so )
( cd usr/X11R6/lib ; rm -rf libXpm.so )
( cd usr/X11R6/lib ; ln -sf libXpm.so.4.11 libXpm.so )
( cd usr/X11R6/lib ; rm -rf libXrender.so.1 )
( cd usr/X11R6/lib ; ln -sf libXrender.so.1.2 libXrender.so.1 )
( cd usr/X11R6/lib ; rm -rf libXcursor.so.1 )
( cd usr/X11R6/lib ; ln -sf libXcursor.so.1.0 libXcursor.so.1 )
( cd usr/X11R6/lib ; rm -rf libXext.so.6 )
( cd usr/X11R6/lib ; ln -sf libXext.so.6.4 libXext.so.6 )
( cd usr/X11R6/lib ; rm -rf libSM.so.6 )
( cd usr/X11R6/lib ; ln -sf libSM.so.6.0 libSM.so.6 )
( cd usr/X11R6/lib ; rm -rf libdps.so.1 )
( cd usr/X11R6/lib ; ln -sf libdps.so.1.0 libdps.so.1 )
( cd usr/X11R6/lib ; rm -rf libXi.so.6 )
( cd usr/X11R6/lib ; ln -sf libXi.so.6.0 libXi.so.6 )
( cd usr/X11R6/lib ; rm -rf libdpstk.so )
( cd usr/X11R6/lib ; ln -sf libdpstk.so.1.0 libdpstk.so )
( cd usr/X11R6/lib ; rm -rf libdps.so )
( cd usr/X11R6/lib ; ln -sf libdps.so.1.0 libdps.so )
