Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH] data: Revert expandKeys warning move
@ 2015-05-26 15:16 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2015-05-26 15:16 UTC (permalink / raw)
  To: bitbake-devel

This was incorrect, it *must* be done next to the rename as a previous
may overlap with the current one and we need to detect this case.

I'll add a test case to better catch this problem in future.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index e7557aa..456052b 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -156,17 +156,17 @@ def expandKeys(alterdata, readdata = None):
         if key == ekey:
             continue
         todolist[key] = ekey
-        newval = alterdata.getVar(ekey, 0)
-        if newval is not None:
-            val = alterdata.getVar(key, 0)
-            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
     # usefulness of the expand cache
 
     for key in sorted(todolist):
         ekey = todolist[key]
+        newval = alterdata.getVar(ekey, 0)
+        if newval is not None:
+            val = alterdata.getVar(key, 0)
+            if val 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 related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-26 15:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-26 15:16 [PATCH] data: Revert expandKeys warning move Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox