public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Paul Barker <paul@pbarker.dev>
To: openembedded-core@lists.openembedded.org
Cc: Paul Barker <paul@pbarker.dev>
Subject: [PATCH 2/3] oelib: utils: Support opting out of all features
Date: Fri, 03 Apr 2026 09:38:33 +0100	[thread overview]
Message-ID: <20260403-default-features-2-v1-2-cba2a1e6224c@pbarker.dev> (raw)
In-Reply-To: <20260403-default-features-2-v1-0-cba2a1e6224c@pbarker.dev>

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>
---
 meta/lib/oe/utils.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 5c722d230842..639c037c1a01 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -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))

-- 
2.43.0



  parent reply	other threads:[~2026-04-03  8:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03  8:38 [PATCH 0/3] Follow up patches for default features Paul Barker
2026-04-03  8:38 ` [PATCH 1/3] bitbake.conf: Document renamed default machine/distro features vars Paul Barker
2026-04-03  8:38 ` Paul Barker [this message]
2026-04-03  8:38 ` [PATCH 3/3] oelib: utils: Fix description of set_difference Paul Barker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260403-default-features-2-v1-2-cba2a1e6224c@pbarker.dev \
    --to=paul@pbarker.dev \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox