commit:     50ff065438d63596d5651ac0b5c36adbdc9b5d1b
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 10 21:58:02 2022 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Mon Oct 10 22:00:52 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=50ff0654

net-dns/ddclient: add exist check for config

Check, if old config exists before migrating it.

Closes: https://bugs.gentoo.org/876628
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 net-dns/ddclient/ddclient-3.10.0_rc2.ebuild | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/net-dns/ddclient/ddclient-3.10.0_rc2.ebuild 
b/net-dns/ddclient/ddclient-3.10.0_rc2.ebuild
index 62aa3c885802..f4d5478a2573 100644
--- a/net-dns/ddclient/ddclient-3.10.0_rc2.ebuild
+++ b/net-dns/ddclient/ddclient-3.10.0_rc2.ebuild
@@ -66,12 +66,12 @@ pkg_postinst() {
        if [[ ${REPLACING_VERSIONS} ]]; then
                for v in ${REPLACING_VERSIONS}; do
                        if ver_test "${v}" -lt 3.10.0; then
-                               cp /etc/ddclient/ddclient.conf 
/etc/ddclient.conf || die
-
-                               ewarn "Your DDClient configuration has been 
copied from"
-                               ewarn "'/etc/ddclient/ddclient.conf' to 
'/etc/ddclient.conf'."
-                               ewarn "Please check your configuration."
-
+                               if [ -f "${EROOT}/etc/ddclient/ddclient.conf" 
]; then
+                                       cp /etc/ddclient/ddclient.conf 
/etc/ddclient.conf || die
+                                       ewarn "Your DDClient configuration has 
been copied from"
+                                       ewarn "'/etc/ddclient/ddclient.conf' to 
'/etc/ddclient.conf'."
+                                       ewarn "Please check your configuration."
+                               fi
                                break
                        fi
                done

Reply via email to