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 libasn1-samba4.so.8 )
( cd usr/lib ; ln -sf libasn1-samba4.so.8.0.0 libasn1-samba4.so.8 )
( cd usr/lib ; rm -rf libcom_err-samba4.so.0 )
( cd usr/lib ; ln -sf libcom_err-samba4.so.0.25 libcom_err-samba4.so.0 )
( 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.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 libgssapi-samba4.so.2 )
( cd usr/lib ; ln -sf libgssapi-samba4.so.2.0.0 libgssapi-samba4.so.2 )
( cd usr/lib ; rm -rf libhcrypto-samba4.so.5 )
( cd usr/lib ; ln -sf libhcrypto-samba4.so.5.0.1 libhcrypto-samba4.so.5 )
( cd usr/lib ; rm -rf libhdb-samba4.so.11 )
( cd usr/lib ; ln -sf libhdb-samba4.so.11.0.2 libhdb-samba4.so.11 )
( cd usr/lib ; rm -rf libheimbase-samba4.so.1 )
( cd usr/lib ; ln -sf libheimbase-samba4.so.1.0.0 libheimbase-samba4.so.1 )
( cd usr/lib ; rm -rf libheimntlm-samba4.so.1 )
( cd usr/lib ; ln -sf libheimntlm-samba4.so.1.0.1 libheimntlm-samba4.so.1 )
( cd usr/lib ; rm -rf libhx509-samba4.so.5 )
( cd usr/lib ; ln -sf libhx509-samba4.so.5.0.0 libhx509-samba4.so.5 )
( cd usr/lib ; rm -rf libkdc-samba4.so.2 )
( cd usr/lib ; ln -sf libkdc-samba4.so.2.0.0 libkdc-samba4.so.2 )
( cd usr/lib ; rm -rf libkrb5-samba4.so.26 )
( cd usr/lib ; ln -sf libkrb5-samba4.so.26.0.0 libkrb5-samba4.so.26 )
( cd usr/lib ; rm -rf libldb.so.2 )
( cd usr/lib ; ln -sf libldb.so.2.0.8 libldb.so.2 )
( 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.0.2.0 libndr.so )
( cd usr/lib ; rm -rf libndr.so.0 )
( cd usr/lib ; ln -sf libndr.so.0.2.0 libndr.so.0 )
( cd usr/lib ; rm -rf libnetapi.so )
( cd usr/lib ; ln -sf libnetapi.so.0 libnetapi.so )
( cd usr/lib ; rm -rf libnss_winbind.so )
( cd usr/lib ; ln -sf libnss_winbind.so.2 libnss_winbind.so )
( cd usr/lib ; rm -rf libnss_wins.so )
( cd usr/lib ; ln -sf libnss_wins.so.2 libnss_wins.so )
( cd usr/lib ; rm -rf libpyldb-util.cpython-38-i386-linux-gnu.so.2 )
( cd usr/lib ; ln -sf libpyldb-util.cpython-38-i386-linux-gnu.so.2.0.8 libpyldb-util.cpython-38-i386-linux-gnu.so.2 )
( cd usr/lib ; rm -rf libroken-samba4.so.19 )
( cd usr/lib ; ln -sf libroken-samba4.so.19.0.1 libroken-samba4.so.19 )
( cd usr/lib ; rm -rf libsamba-credentials.so )
( cd usr/lib ; ln -sf libsamba-credentials.so.0.0.1 libsamba-credentials.so )
( cd usr/lib ; rm -rf libsamba-credentials.so.0 )
( cd usr/lib ; ln -sf libsamba-credentials.so.0.0.1 libsamba-credentials.so.0 )
( cd usr/lib ; rm -rf libsamba-errors.so )
( cd usr/lib ; ln -sf libsamba-errors.so.1 libsamba-errors.so )
( 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-38-i386-linux-gnu.so )
( cd usr/lib ; ln -sf libsamba-policy.cpython-38-i386-linux-gnu.so.0.0.1 libsamba-policy.cpython-38-i386-linux-gnu.so )
( cd usr/lib ; rm -rf libsamba-policy.cpython-38-i386-linux-gnu.so.0 )
( cd usr/lib ; ln -sf libsamba-policy.cpython-38-i386-linux-gnu.so.0.0.1 libsamba-policy.cpython-38-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.5.0 libsmbclient.so )
( cd usr/lib ; rm -rf libsmbclient.so.0 )
( cd usr/lib ; ln -sf libsmbclient.so.0.5.0 libsmbclient.so.0 )
( cd usr/lib ; rm -rf libsmbconf.so )
( cd usr/lib ; ln -sf libsmbconf.so.0 libsmbconf.so )
( cd usr/lib ; rm -rf libsmbldap.so )
( cd usr/lib ; ln -sf libsmbldap.so.2 libsmbldap.so )
( 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 )
( cd usr/lib ; rm -rf libwind-samba4.so.0 )
( cd usr/lib ; ln -sf libwind-samba4.so.0.0.0 libwind-samba4.so.0 )
