From: Louis Rannou <louis.rannou@syslinbit.com>
To: bitbake-devel@lists.openembedded.org
Cc: Louis Rannou <louis.rannou@syslinbit.com>,
louis.rannou@non.se.com, pascal.eberhard@se.com,
yoann.congal@smile.fr
Subject: [PATCH 1/2] bitbake: data_smart: fix ??= operator for getVarFlags
Date: Wed, 12 Feb 2025 13:16:18 +0100 [thread overview]
Message-ID: <20250212-varflags-v1-1-3a756c7aa95c@syslinbit.com> (raw)
In-Reply-To: <20250212-varflags-v1-0-3a756c7aa95c@syslinbit.com>
From: Louis Rannou <louis.rannou@non.se.com>
Variable flags have been fixed in commit
0329a7e3ac694737f2d2c1861f65492551360663 which introduces the
"_defaultval_flag_" prefix for default values. This must not be ignored as
others "_"-prefixed flags names.
Split the processing of default values to be sure they are overwritted by the
others operators disregarding of their order.
Fixes [YOCTO #15685]
Signed-off-by: Louis Rannou <louis.rannou@non.se.com>
---
lib/bb/data_smart.py | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 897ceeb32c7ce0acb8ed44c25e1bf2f2f28aa9dc..7663f28c5071a77c8452c1016e5ee0d969c84bec 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -952,12 +952,22 @@ class DataSmart(MutableMapping):
def getVarFlags(self, var, expand = False, internalflags=False):
local_var = self._findVar(var)
flags = {}
+ flags_set = {}
if local_var:
- for i in local_var:
- if i.startswith(("_", ":")) and not internalflags:
+ for i, val in local_var.items():
+ if i.startswith("_defaultval_flag_"):
+ i = i[len("_defaultval_flag_"):]
+ flags[i] = val
+ elif i.startswith(("_", ":")) and not internalflags:
continue
- flags[i] = local_var[i]
+ else:
+ flags_set[i] = val
+
+ # Flags sets take over defaults
+ flags.update(flags_set)
+
+ for i in flags:
if expand and i in expand:
flags[i] = self.expand(flags[i], var + "[" + i + "]")
if len(flags) == 0:
--
2.48.1
next prev parent reply other threads:[~2025-02-12 12:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 12:16 [PATCH 0/2] bitbake: fix ??= operator for getVarFlags and test Louis Rannou
2025-02-12 12:16 ` Louis Rannou [this message]
2025-02-12 14:00 ` [bitbake-devel] [PATCH 1/2] bitbake: data_smart: fix ??= operator for getVarFlags Richard Purdie
2025-02-12 14:13 ` Richard Purdie
2025-02-12 17:01 ` Louis Rannou
2025-02-12 12:16 ` [PATCH 2/2] bitbake: tests/parse: add test " Louis Rannou
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=20250212-varflags-v1-1-3a756c7aa95c@syslinbit.com \
--to=louis.rannou@syslinbit.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=louis.rannou@non.se.com \
--cc=pascal.eberhard@se.com \
--cc=yoann.congal@smile.fr \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.