From: Mark Hatle <mark.hatle@windriver.com>
To: <bitbake-devel@lists.openembedded.org>
Subject: [PATCH] data.py: Add a warning when expandKeys overwrites an existing key
Date: Tue, 19 Mar 2013 15:28:51 -0500 [thread overview]
Message-ID: <1363724931-31720-1-git-send-email-mark.hatle@windriver.com> (raw)
When two variables are defined as:
${var} = "bar"
foo = "foobar"
The value of 'foo' when ${var} == foo becomes indeterminate. We
want to warn a user when this situation has been encountered so they
can take corrective actions.
In the above example usually foo == bar, unless multilibs are enabled.
Then ml-foo = "ml-foobar".
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
lib/bb/data.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/bb/data.py b/lib/bb/data.py
index 7047f48..110666c 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -158,6 +158,11 @@ def expandKeys(alterdata, readdata = None):
for key in todolist:
ekey = todolist[key]
+ if ekey in keys(alterdata):
+ val = alterdata.getVar(key, 0)
+ newval = alterdata.getVar(ekey, 0)
+ if val is not None and newval is not None:
+ bb.warn("Variable key %s (%s) replaces original key %s (%s)." % (key, val, ekey, newval))
alterdata.renameVar(key, ekey)
def inheritFromOS(d, savedenv, permitted):
--
1.8.1.2.545.g2f19ada
next reply other threads:[~2013-03-19 20:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-19 20:28 Mark Hatle [this message]
2013-03-19 19:54 ` [PATCH] data.py: Add a warning when expandKeys overwrites an existing key Mark Hatle
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=1363724931-31720-1-git-send-email-mark.hatle@windriver.com \
--to=mark.hatle@windriver.com \
--cc=bitbake-devel@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;
as well as URLs for NNTP newsgroup(s).