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...
}



if [ ! -d etc/slapt-get ]; then
mkdir -p etc/slapt-get
fi

if [ -f etc/slapt-getrc -a ! -f etc/slapt-get/slapt-getrc ]; then
mv -f etc/slapt-getrc etc/slapt-get/slapt-getrc
fi

if [ ! -f etc/slapt-get/slapt-getrc ]; then
mv -f etc/slapt-get/slapt-getrc.new etc/slapt-get/slapt-getrc
else cmp etc/slapt-get/slapt-getrc etc/slapt-get/slapt-getrc.new >/dev/null 2>&1 && rm etc/slapt-get/slapt-getrc.new
fi

config usr/local/bin/snukctl.new
config usr/local/lib/slapt/plugins/install-new.new
config usr/local/lib/slapt/plugins/audit.new
config usr/local/lib/slapt/plugins/help.new
config usr/local/lib/slapt/lib/policy.sh.new
