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 usr/lib ; rm -rf libdcerpc-binding.so )
( cd usr/lib ; ln -sf libdcerpc-binding.so.0.0.1 libdcerpc-binding.so )
( cd usr/lib ; rm -rf libdcerpc-binding.so.0 )
( cd usr/lib ; ln -sf libdcerpc-binding.so.0.0.1 libdcerpc-binding.so.0 )
( cd usr/lib ; rm -rf libdcerpc-samr.so )
( cd usr/lib ; ln -sf libdcerpc-samr.so.0.0.1 libdcerpc-samr.so )
( cd usr/lib ; rm -rf libdcerpc-samr.so.0 )
( cd usr/lib ; ln -sf libdcerpc-samr.so.0.0.1 libdcerpc-samr.so.0 )
( cd usr/lib ; rm -rf libdcerpc-server-core.so )
( cd usr/lib ; ln -sf libdcerpc-server-core.so.0.0.1 libdcerpc-server-core.so )
( cd usr/lib ; rm -rf libdcerpc-server-core.so.0 )
( cd usr/lib ; ln -sf libdcerpc-server-core.so.0.0.1 libdcerpc-server-core.so.0 )
( cd usr/lib ; rm -rf libdcerpc-server.so )
( cd usr/lib ; ln -sf libdcerpc-server.so.0.0.1 libdcerpc-server.so )
( cd usr/lib ; rm -rf libdcerpc-server.so.0 )
( cd usr/lib ; ln -sf libdcerpc-server.so.0.0.1 libdcerpc-server.so.0 )
( cd usr/lib ; rm -rf libdcerpc.so )
( cd usr/lib ; ln -sf libdcerpc.so.0.0.1 libdcerpc.so )
( cd usr/lib ; rm -rf libdcerpc.so.0 )
( cd usr/lib ; ln -sf libdcerpc.so.0.0.1 libdcerpc.so.0 )
( cd usr/lib ; rm -rf libndr-krb5pac.so )
( cd usr/lib ; ln -sf libndr-krb5pac.so.0.0.1 libndr-krb5pac.so )
( cd usr/lib ; rm -rf libndr-krb5pac.so.0 )
( cd usr/lib ; ln -sf libndr-krb5pac.so.0.0.1 libndr-krb5pac.so.0 )
( cd usr/lib ; rm -rf libndr-nbt.so )
( cd usr/lib ; ln -sf libndr-nbt.so.0.0.1 libndr-nbt.so )
( cd usr/lib ; rm -rf libndr-nbt.so.0 )
( cd usr/lib ; ln -sf libndr-nbt.so.0.0.1 libndr-nbt.so.0 )
( cd usr/lib ; rm -rf libndr-standard.so )
( cd usr/lib ; ln -sf libndr-standard.so.0.0.1 libndr-standard.so )
( cd usr/lib ; rm -rf libndr-standard.so.0 )
( cd usr/lib ; ln -sf libndr-standard.so.0.0.1 libndr-standard.so.0 )
( cd usr/lib ; rm -rf libndr.so )
( cd usr/lib ; ln -sf libndr.so.3.0.0 libndr.so )
( cd usr/lib ; rm -rf libndr.so.3 )
( cd usr/lib ; ln -sf libndr.so.3.0.0 libndr.so.3 )
( cd usr/lib ; rm -rf libnetapi.so )
( cd usr/lib ; ln -sf libnetapi.so.1.0.0 libnetapi.so )
( cd usr/lib ; rm -rf libnetapi.so.1 )
( cd usr/lib ; ln -sf libnetapi.so.1.0.0 libnetapi.so.1 )
( cd usr/lib ; rm -rf libsamba-credentials.so )
( cd usr/lib ; ln -sf libsamba-credentials.so.1.0.0 libsamba-credentials.so )
( cd usr/lib ; rm -rf libsamba-credentials.so.1 )
( cd usr/lib ; ln -sf libsamba-credentials.so.1.0.0 libsamba-credentials.so.1 )
( cd usr/lib ; rm -rf libsamba-errors.so )
( cd usr/lib ; ln -sf libsamba-errors.so.1.0.0 libsamba-errors.so )
( cd usr/lib ; rm -rf libsamba-errors.so.1 )
( cd usr/lib ; ln -sf libsamba-errors.so.1.0.0 libsamba-errors.so.1 )
( cd usr/lib ; rm -rf libsamba-hostconfig.so )
( cd usr/lib ; ln -sf libsamba-hostconfig.so.0.0.1 libsamba-hostconfig.so )
( cd usr/lib ; rm -rf libsamba-hostconfig.so.0 )
( cd usr/lib ; ln -sf libsamba-hostconfig.so.0.0.1 libsamba-hostconfig.so.0 )
( cd usr/lib ; rm -rf libsamba-passdb.so )
( cd usr/lib ; ln -sf libsamba-passdb.so.0.28.0 libsamba-passdb.so )
( cd usr/lib ; rm -rf libsamba-passdb.so.0 )
( cd usr/lib ; ln -sf libsamba-passdb.so.0.28.0 libsamba-passdb.so.0 )
( cd usr/lib ; rm -rf libsamba-policy.cpython-39-i386-linux-gnu.so )
( cd usr/lib ; ln -sf libsamba-policy.cpython-39-i386-linux-gnu.so.0.0.1 libsamba-policy.cpython-39-i386-linux-gnu.so )
( cd usr/lib ; rm -rf libsamba-policy.cpython-39-i386-linux-gnu.so.0 )
( cd usr/lib ; ln -sf libsamba-policy.cpython-39-i386-linux-gnu.so.0.0.1 libsamba-policy.cpython-39-i386-linux-gnu.so.0 )
( cd usr/lib ; rm -rf libsamba-util.so )
( cd usr/lib ; ln -sf libsamba-util.so.0.0.1 libsamba-util.so )
( cd usr/lib ; rm -rf libsamba-util.so.0 )
( cd usr/lib ; ln -sf libsamba-util.so.0.0.1 libsamba-util.so.0 )
( cd usr/lib ; rm -rf libsamdb.so )
( cd usr/lib ; ln -sf libsamdb.so.0.0.1 libsamdb.so )
( cd usr/lib ; rm -rf libsamdb.so.0 )
( cd usr/lib ; ln -sf libsamdb.so.0.0.1 libsamdb.so.0 )
( cd usr/lib ; rm -rf libsmbclient.so )
( cd usr/lib ; ln -sf libsmbclient.so.0.7.0 libsmbclient.so )
( cd usr/lib ; rm -rf libsmbclient.so.0 )
( cd usr/lib ; ln -sf libsmbclient.so.0.7.0 libsmbclient.so.0 )
( cd usr/lib ; rm -rf libsmbconf.so )
( cd usr/lib ; ln -sf libsmbconf.so.0.0.1 libsmbconf.so )
( cd usr/lib ; rm -rf libsmbconf.so.0 )
( cd usr/lib ; ln -sf libsmbconf.so.0.0.1 libsmbconf.so.0 )
( cd usr/lib ; rm -rf libsmbldap.so )
( cd usr/lib ; ln -sf libsmbldap.so.2.1.0 libsmbldap.so )
( cd usr/lib ; rm -rf libsmbldap.so.2 )
( cd usr/lib ; ln -sf libsmbldap.so.2.1.0 libsmbldap.so.2 )
( cd usr/lib ; rm -rf libtevent-util.so )
( cd usr/lib ; ln -sf libtevent-util.so.0.0.1 libtevent-util.so )
( cd usr/lib ; rm -rf libtevent-util.so.0 )
( cd usr/lib ; ln -sf libtevent-util.so.0.0.1 libtevent-util.so.0 )
( cd usr/lib ; rm -rf libwbclient.so )
( cd usr/lib ; ln -sf libwbclient.so.0.15 libwbclient.so )
( cd usr/lib ; rm -rf libwbclient.so.0 )
( cd usr/lib ; ln -sf libwbclient.so.0.15 libwbclient.so.0 )
