From: Chris Hofstaedtler Date: Tue, 20 Feb 2018 09:54:06 +0000 (+0100) Subject: debian: fix ucf registration (same as Debian bug#816362) X-Git-Tag: dnsdist-1.3.0~89^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=597f3ff73b077c4e4d418e9733235c064ccf4551;p=pdns debian: fix ucf registration (same as Debian bug#816362) --- diff --git a/build-scripts/debian-authoritative/pdns-backend-mysql.postinst b/build-scripts/debian-authoritative/pdns-backend-mysql.postinst index 77706a0f0..d4d7ee922 100644 --- a/build-scripts/debian-authoritative/pdns-backend-mysql.postinst +++ b/build-scripts/debian-authoritative/pdns-backend-mysql.postinst @@ -9,7 +9,7 @@ if [ -n "$PDNSDEBUG" ]; then set -x fi -PKGNAME="pdns-backend-gmysql" +PKGNAME="pdns-backend-mysql" # rename ucf-conffile. This was mostly stolen from cacti.postinst after # a short discussion on debian-mentors, see @@ -41,6 +41,10 @@ renameconffile() { } if [ "$1" = "configure" ]; then + if ucfq -w /etc/powerdns/pdns.d/pdns.local.gmysql.conf | grep 'pdns-backend-gmysql' >/dev/null; then + # before 4.0.0~beta1 (Debian), 4.1.2... (powerdns.com), PKGNAME was incorrectly set to pdns-backend-gmysql. Fix that. + ucfr --purge 'pdns-backend-gmysql' '/etc/powerdns/pdns.d/pdns.local.gmysql.conf' + fi if [ -n "$2" ] && dpkg --compare-versions "$2" lt 3.3; then renameconffile /etc/powerdns/pdns.d/pdns.local.gmysql /etc/powerdns/pdns.d/pdns.local.gmysql.conf /dev/null fi diff --git a/build-scripts/debian-authoritative/pdns-backend-mysql.postrm b/build-scripts/debian-authoritative/pdns-backend-mysql.postrm index a2702244c..378688ed1 100644 --- a/build-scripts/debian-authoritative/pdns-backend-mysql.postrm +++ b/build-scripts/debian-authoritative/pdns-backend-mysql.postrm @@ -14,24 +14,11 @@ PKGNAME="pdns-backend-mysql" # Remove configuration file if [ "$1" = "purge" ]; then # Remove files registered with ucf. - # this has been pulled from aide-common.postrm - - UCF="ucf" - UCFR="ucfr" - if command -v ucfq >/dev/null; then for file in $(ucfq --with-colons "$PKGNAME" | cut --delimiter=: --fields=1); do - for ext in '~' '%' .bak .dpkg-tmp .dpkg-new .dpkg-old .dpkg-dist; do - rm -f ${file}$ext - done rm -f ${file} - - if command -v $UCF >/dev/null; then - $UCF --purge ${file} - fi - if command -v $UCFR >/dev/null; then - $UCFR --purge $PKGNAME ${file} - fi + ucf --purge ${file} + ucfr --purge $PKGNAME ${file} done else echo >&2 "ucf no longer installed, not cleaning up"