nss-mdns: do not unconditionally override hosts: line in nsswitch.conf
authorPeter Korsgaard <peter@korsgaard.com>
Sat, 20 Oct 2018 21:41:07 +0000 (23:41 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sat, 20 Oct 2018 23:50:35 +0000 (01:50 +0200)
Instead, add mdns4_minimal / mdns4 around the dns entry if missing.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/nss-mdns/nss-mdns.mk

index 63f40e718a8bdab0ad23eafe66f7124eb92bd40f..1512ea2e7f5e36f8ecc58112ea9fcd8253a39f5b 100644 (file)
@@ -9,8 +9,9 @@ NSS_MDNS_SITE = http://0pointer.de/lennart/projects/nss-mdns
 NSS_MDNS_LICENSE = LGPL-2.1+
 NSS_MDNS_LICENSE_FILES = LICENSE
 
+# add mdns4_minimal / mdns around the dns provider if missing
 define NSS_MDNS_INSTALL_CONFIG
-       sed -r -i -e 's/^(hosts:[[:space:]]+).*/\1files mdns4_minimal [NOTFOUND=return] dns mdns4/' \
+       $(SED) '/^hosts:/ {/mdns4/! s/dns/mdns4_minimal [NOTFOUND=return] dns mdns4/}' \
                $(TARGET_DIR)/etc/nsswitch.conf
 endef