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}
}
( cd lib ; rm -rf libblkid.so.1 )
( cd lib ; ln -sf libblkid.so.1.1.0 libblkid.so.1 )
( cd lib ; rm -rf libfdisk.so.1 )
( cd lib ; ln -sf libfdisk.so.1.1.0 libfdisk.so.1 )
( cd lib ; rm -rf libmount.so.1 )
( cd lib ; ln -sf libmount.so.1.1.0 libmount.so.1 )
( cd lib ; rm -rf libsmartcols.so.1 )
( cd lib ; ln -sf libsmartcols.so.1.1.0 libsmartcols.so.1 )
( cd lib ; rm -rf libuuid.so.1 )
( cd lib ; ln -sf libuuid.so.1.3.0 libuuid.so.1 )
( cd usr/bin/32 ; rm -rf getopt )
( cd usr/bin/32 ; ln -sf ../../../bin/getopt getopt )
( cd usr/bin/32 ; rm -rf i386 )
( cd usr/bin/32 ; ln -sf setarch i386 )
( cd usr/bin/32 ; rm -rf lastb )
( cd usr/bin/32 ; ln -sf last lastb )
( cd usr/bin/32 ; rm -rf linux32 )
( cd usr/bin/32 ; ln -sf setarch linux32 )
( cd usr/bin/32 ; rm -rf linux64 )
( cd usr/bin/32 ; ln -sf setarch linux64 )
( cd usr/bin/32 ; rm -rf more )
( cd usr/bin/32 ; ln -sf ../../../bin/more more )
( cd usr/bin/32 ; rm -rf readprofile )
( cd usr/bin/32 ; rm -rf setterm )
( cd usr/bin/32 ; ln -sf ../../../bin/setterm setterm )
( cd usr/bin/32 ; rm -rf uname26 )
( cd usr/bin/32 ; ln -sf setarch uname26 )
( cd usr/lib ; rm -rf libblkid.so )
( cd usr/lib ; ln -sf ../../lib/libblkid.so.1 libblkid.so )
( cd usr/lib ; rm -rf libfdisk.so )
( cd usr/lib ; ln -sf ../../lib/libfdisk.so.1 libfdisk.so )
( cd usr/lib ; rm -rf liblastlog2.so )
( cd usr/lib ; ln -sf liblastlog2.so.2.0.0 liblastlog2.so )
( cd usr/lib ; rm -rf liblastlog2.so.2 )
( cd usr/lib ; ln -sf liblastlog2.so.2.0.0 liblastlog2.so.2 )
( cd usr/lib ; rm -rf libmount.so )
( cd usr/lib ; ln -sf ../../lib/libmount.so.1 libmount.so )
( cd usr/lib ; rm -rf libsmartcols.so )
( cd usr/lib ; ln -sf ../../lib/libsmartcols.so.1 libsmartcols.so )
( cd usr/lib ; rm -rf libuuid.so )
( cd usr/lib ; ln -sf ../../lib/libuuid.so.1 libuuid.so )
