Skip to contentSkip to conversation

data: Revert expandKeys warning move

PATCH New Richard Purdie 1 participant 1 message May 26, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 data: Revert expandKeys warning move

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.

bitbake/lib/bb/data.py +5 -5
index e7557aa..456052b 100644
@@ -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):