]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oelib: utils: Support opting out of all features
authorPaul Barker <paul@pbarker.dev>
Fri, 3 Apr 2026 08:38:33 +0000 (09:38 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 7 Apr 2026 10:45:50 +0000 (11:45 +0100)
If '*' is present as a separate token in DISTRO_FEATURES_OPTED_OUT or
MACHINE_FEATURES_OPTED_OUT, interpret this as opting out of all default
features.

If '*' is part of a larger word, this is not treated specially - 'FOO*'
will not trigger removal of all features.

This is implemented in set_difference() so that the behaviour can be
reused in other similar processing we may need to do in the future.

Signed-off-by: Paul Barker <paul@pbarker.dev>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/utils.py

index 5c722d230842d74630a9fc2555f02f5142bea438..639c037c1a014d3ac7fca7379e6583751f929939 100644 (file)
@@ -93,6 +93,13 @@ def set_difference(variable1, variable2, d):
     s2 = "b c d"
     s3 = set_difference(s1, s2)
     => s3 = "a"
+
+    If '*' is present as a separate token (not part of a larger identifier) in
+    the second operand, this is interpreted as "remove all entries":
+    s1 = "a b c"
+    s2 = "*"
+    s3 = set_difference(s1, s2)
+    => s3 = ""
     """
     val1 = d.getVar(variable1)
     if not val1:
@@ -104,6 +111,9 @@ def set_difference(variable1, variable2, d):
     val1 = set(val1.split())
     val2 = set(val2.split())
 
+    if "*" in val2:
+        return ""
+
     # Return a sorted string to ensure that the result is consistent between
     # parser runs.
     return " ".join(sorted(val1 - val2))