#!/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/hal/fdi/policy/x11-input.fdi.new
config etc/dbus-1/system.d/xorg-server.conf.new
( cd usr/lib ; rm -rf modules )
( cd usr/lib ; ln -sf xorg/modules modules )
( cd usr/lib/xorg/modules ; rm -rf dri )
( cd usr/lib/xorg/modules ; ln -sf ../../dri dri )
( cd usr/lib ; rm -rf xserver )
( cd usr/lib ; ln -sf ../../etc/X11/xserver xserver )
( cd usr/bin ; rm -rf X )
( cd usr/bin ; ln -sf Xorg X )
