From: Koen Kooi Date: Tue, 9 Sep 2025 11:24:48 +0000 (+0200) Subject: systemd: change pni-names logic to something less confusing X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=52ea4612f9262a9e607fb3eee08906ec687197ee;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git systemd: change pni-names logic to something less confusing Using bb.utils.contains in negative logic leads to either overly verbose or plain confusing code, so harness the power of Ross and Antonin to make this less verbose and slightly clearer. This moves the negative logic from the inline python ('true if not') to bash ('if !'). Signed-off-by: Koen Kooi Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-core/systemd/systemd_257.8.bb b/meta/recipes-core/systemd/systemd_257.8.bb index 6399c57640..549eb7fb29 100644 --- a/meta/recipes-core/systemd/systemd_257.8.bb +++ b/meta/recipes-core/systemd/systemd_257.8.bb @@ -401,7 +401,7 @@ do_install() { fi # Actively disable Predictable Network Interface Names - if ${@ 'true' if not bb.utils.contains('PACKAGECONFIG', 'pni-names', 'true', 'false', d) else 'false'}; then + if ! ${@bb.utils.contains('PACKAGECONFIG', 'pni-names', 'true', 'false', d)}; then sed -i 's/^NamePolicy=.*/NamePolicy=/;s/^AlternativeNamesPolicy=.*/AlternativeNamesPolicy=/' ${D}${nonarch_libdir}/systemd/network/99-default.link fi }