package/nss-mdns: do not overwrite user's nsswitch.conf
authorYann E. MORIN <yann.morin.1998@free.fr>
Thu, 18 Jul 2013 21:24:14 +0000 (23:24 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Thu, 18 Jul 2013 22:38:57 +0000 (00:38 +0200)
Instead of over-writing the nsswitch.conf file (which may already contain
user's specific configuration if it comes from a custom skeleton), just
replace the 'hosts' line.

Remove now-useless custom nsswitch.conf file.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/nss-mdns/nss-mdns.mk
package/nss-mdns/nsswitch.conf [deleted file]

index 4d366335e22ddcfdadbc6866c3f22e4f01eeae82..83d9a2a951ebc98bfc912b18d0af78b15c7e2d0d 100644 (file)
@@ -10,7 +10,8 @@ NSS_MDNS_SITE=http://0pointer.de/lennart/projects/nss-mdns
 NSS_MDNS_CONF_OPT += --localstatedir=/var
 
 define NSS_MDNS_INSTALL_CONFIG
-       $(INSTALL) -D -m 0664 package/nss-mdns/nsswitch.conf $(TARGET_DIR)/etc/nsswitch.conf
+       sed -r -i -e 's/^(hosts:[[:space:]]+).*/\1files mdns4_minimal [NOTFOUND=return] dns mdns4/' \
+           $(TARGET_DIR)/etc/nsswitch.conf
 endef
 
 NSS_MDNS_POST_INSTALL_TARGET_HOOKS += NSS_MDNS_INSTALL_CONFIG
diff --git a/package/nss-mdns/nsswitch.conf b/package/nss-mdns/nsswitch.conf
deleted file mode 100644 (file)
index 94174e0..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# /etc/nsswitch.conf
-
-passwd:         compat
-group:          compat
-shadow:         compat
-
-hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
-networks:       files
-
-protocols:      db files
-services:       db files
-ethers:         db files
-rpc:            db files
-
-netgroup:       nis