]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
systemd: change pni-names logic to something less confusing
authorKoen Kooi <koen.kooi@oss.qualcomm.com>
Tue, 9 Sep 2025 11:24:48 +0000 (13:24 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 11 Sep 2025 09:45:08 +0000 (10:45 +0100)
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 <koen.kooi@oss.qualcomm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/systemd/systemd_257.8.bb

index 6399c576409d5910581e1d4d567fb16d89f6b4cf..549eb7fb29a0565395d788e4309c4dcb8642f07f 100644 (file)
@@ -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
 }