* [PATCH] data.py: Add a warning when expandKeys overwrites an existing key
@ 2013-03-19 20:28 Mark Hatle
2013-03-19 19:54 ` Mark Hatle
0 siblings, 1 reply; 2+ messages in thread
From: Mark Hatle @ 2013-03-19 20:28 UTC (permalink / raw)
To: bitbake-devel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] data.py: Add a warning when expandKeys overwrites an existing key
2013-03-19 20:28 [PATCH] data.py: Add a warning when expandKeys overwrites an existing key Mark Hatle
@ 2013-03-19 19:54 ` Mark Hatle
0 siblings, 0 replies; 2+ messages in thread
From: Mark Hatle @ 2013-03-19 19:54 UTC (permalink / raw)
To: bitbake-devel
On 3/19/13 3:28 PM, Mark Hatle wrote:
> 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".
This patch highlights the places where a problem may exist. When used with the
current oe-core, it highlights a number of problems with the multilib
configuration code. (See patch sent to oe-core.)
I'd like to see this incorporated, but at this point it's definitely an RFC.
> 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):
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-19 20:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-19 20:28 [PATCH] data.py: Add a warning when expandKeys overwrites an existing key Mark Hatle
2013-03-19 19:54 ` Mark Hatle
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.