#!/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/distcc/clients.allow.new
config etc/distcc/commands.allow.sh.new
config etc/distcc/hosts.new
( cd usr/lib/distcc ; rm -rf arm-slackware-linux-gnueabihf-11.2.0 )
( cd usr/lib/distcc ; ln -sf ../../bin/distcc arm-slackware-linux-gnueabihf-11.2.0 )
( cd usr/lib/distcc ; rm -rf arm-slackware-linux-gnueabihf-g++ )
( cd usr/lib/distcc ; ln -sf ../../bin/distcc arm-slackware-linux-gnueabihf-g++ )
( cd usr/lib/distcc ; rm -rf arm-slackware-linux-gnueabihf-gcc )
( cd usr/lib/distcc ; ln -sf ../../bin/distcc arm-slackware-linux-gnueabihf-gcc )
( cd usr/lib/distcc ; rm -rf c++ )
( cd usr/lib/distcc ; ln -sf ../../bin/distcc c++ )
( cd usr/lib/distcc ; rm -rf c89 )
( cd usr/lib/distcc ; ln -sf ../../bin/distcc c89 )
( cd usr/lib/distcc ; rm -rf c99 )
( cd usr/lib/distcc ; ln -sf ../../bin/distcc c99 )
( cd usr/lib/distcc ; rm -rf cc )
( cd usr/lib/distcc ; ln -sf ../../bin/distcc cc )
( cd usr/lib/distcc ; rm -rf clang )
( cd usr/lib/distcc ; ln -sf ../../bin/distcc clang )
( cd usr/lib/distcc ; rm -rf clang++ )
( cd usr/lib/distcc ; ln -sf ../../bin/distcc clang++ )
( cd usr/lib/distcc ; rm -rf g++ )
( cd usr/lib/distcc ; ln -sf ../../bin/distcc g++ )
( cd usr/lib/distcc ; rm -rf gcc )
( cd usr/lib/distcc ; ln -sf ../../bin/distcc gcc )
( cd usr/lib/distcc ; rm -rf gcc-11.2.0 )
( cd usr/lib/distcc ; ln -sf ../../bin/distcc gcc-11.2.0 )
