* [PATCH] data: Clean up expandKeys None value handling
@ 2015-05-26 10:41 Richard Purdie
2015-05-26 11:49 ` Bernhard Reutner-Fischer
0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2015-05-26 10:41 UTC (permalink / raw)
To: bitbake-devel
This comparison is interesting even in the case of empty vales. Enabling
this warning actually found a bug in the metadata in avahi. Make the
code handle None specifically and also remove the dead code path in the
second if statement.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index 0d9da4c..e7557aa 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -157,9 +157,9 @@ def expandKeys(alterdata, readdata = None):
continue
todolist[key] = ekey
newval = alterdata.getVar(ekey, 0)
- if newval:
+ if newval is not None:
val = alterdata.getVar(key, 0)
- if val is not None and newval is not None:
+ if val is not None:
bb.warn("Variable key %s (%s) replaces original key %s (%s)." % (key, val, ekey, newval))
# These two for loops are split for performance to maximise the
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] data: Clean up expandKeys None value handling
2015-05-26 10:41 [PATCH] data: Clean up expandKeys None value handling Richard Purdie
@ 2015-05-26 11:49 ` Bernhard Reutner-Fischer
0 siblings, 0 replies; 2+ messages in thread
From: Bernhard Reutner-Fischer @ 2015-05-26 11:49 UTC (permalink / raw)
To: Richard Purdie, bitbake-devel
On May 26, 2015 12:41:02 PM GMT+02:00, Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
>This comparison is interesting even in the case of empty vales.
>Enabling
>this warning actually found a bug in the metadata in avahi. Make the
>code handle None specifically and also remove the dead code path in the
>second if statement.
LGTM, but I cannot approve it.
Thanks for the fix!
Cheers,
>
>Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>
>diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
>index 0d9da4c..e7557aa 100644
>--- a/bitbake/lib/bb/data.py
>+++ b/bitbake/lib/bb/data.py
>@@ -157,9 +157,9 @@ def expandKeys(alterdata, readdata = None):
> continue
> todolist[key] = ekey
> newval = alterdata.getVar(ekey, 0)
>- if newval:
>+ if newval is not None:
> val = alterdata.getVar(key, 0)
>- if val is not None and newval is not None:
>+ if val is not None:
>bb.warn("Variable key %s (%s) replaces original key %s (%s)." % (key,
>val, ekey, newval))
>
> # These two for loops are split for performance to maximise the
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-26 11:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-26 10:41 [PATCH] data: Clean up expandKeys None value handling Richard Purdie
2015-05-26 11:49 ` Bernhard Reutner-Fischer
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.