mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
libnss-mdns: fix postinst and postrm
Don't blindly add mdns_minimal, instead check for existing mdns_minimal instances. Fixes continuously appending mdns settings to nssswitch.conf when upgrading. (From OE-Core rev: 9da097b0de6425464ebd3f0539b7495b11d139b5) Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
669a89f377
commit
7897fb35a3
@@ -28,13 +28,16 @@ DEBIANNAME_${PN} = "libnss-mdns"
|
||||
RDEPENDS_${PN} = "avahi-daemon"
|
||||
|
||||
pkg_postinst_${PN} () {
|
||||
sed -e '/^hosts:/s/\s*\<mdns\>//' \
|
||||
-e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdns4_minimal [NOTFOUND=return]\3\4 mdns\5/' \
|
||||
-i $D${sysconfdir}/nsswitch.conf
|
||||
sed '
|
||||
/^hosts:/ !b
|
||||
/\<mdns\(4\|6\)\?\(_minimal\)\?\>/ b
|
||||
s/\([[:blank:]]\+\)dns\>/\1mdns4_minimal [NOTFOUND=return] dns/g
|
||||
' -i $D${sysconfdir}/nsswitch.conf
|
||||
}
|
||||
|
||||
pkg_prerm_${PN} () {
|
||||
sed -e '/^hosts:/s/\s*\<mdns\>//' \
|
||||
-e '/^hosts:/s/\s*mdns4_minimal\s\+\[NOTFOUND=return\]//' \
|
||||
-i $D${sysconfdir}/nsswitch.conf
|
||||
sed '
|
||||
/^hosts:/ !b
|
||||
s/[[:blank:]]\+mdns\(4\|6\)\?\(_minimal\( \[NOTFOUND=return\]\)\?\)\?//g
|
||||
' -i $D${sysconfdir}/nsswitch.conf
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user