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...
}
preserve_perms() {
  NEW="$1"
  OLD="$(dirname ${NEW})/$(basename ${NEW} .new)"
  if [ -e ${OLD} ]; then
    cp -a ${OLD} ${NEW}.incoming
    cat ${NEW} > ${NEW}.incoming
    mv ${NEW}.incoming ${NEW}
  fi
  config ${NEW}
}
# Recompile glib schemas:
( cd usr/bin/32 ; rm -rf pamon )
( cd usr/bin/32 ; ln -sf pacat pamon )
( cd usr/bin/32 ; rm -rf paplay )
( cd usr/bin/32 ; ln -sf pacat paplay )
( cd usr/bin/32 ; rm -rf parec )
( cd usr/bin/32 ; ln -sf pacat parec )
( cd usr/bin/32 ; rm -rf parecord )
( cd usr/bin/32 ; ln -sf pacat parecord )
( cd usr/lib ; rm -rf libpulse-mainloop-glib.so )
( cd usr/lib ; ln -sf libpulse-mainloop-glib.so.0.0.5 libpulse-mainloop-glib.so )
( cd usr/lib ; rm -rf libpulse-mainloop-glib.so.0 )
( cd usr/lib ; ln -sf libpulse-mainloop-glib.so.0.0.5 libpulse-mainloop-glib.so.0 )
( cd usr/lib ; rm -rf libpulse-simple.so )
( cd usr/lib ; ln -sf libpulse-simple.so.0.1.1 libpulse-simple.so )
( cd usr/lib ; rm -rf libpulse-simple.so.0 )
( cd usr/lib ; ln -sf libpulse-simple.so.0.1.1 libpulse-simple.so.0 )
( cd usr/lib ; rm -rf libpulse.so )
( cd usr/lib ; ln -sf libpulse.so.0.20.3 libpulse.so )
( cd usr/lib ; rm -rf libpulse.so.0 )
( cd usr/lib ; ln -sf libpulse.so.0.20.3 libpulse.so.0 )
