summaryrefslogtreecommitdiffstats
path: root/lib/bb/data.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-25 08:53:52 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-25 09:00:16 +0100
commit702b42a47904f2378dd819e7463b3206883c2651 (patch)
tree86082ea1221e8f4303a73b63139f45a6dd85798c /lib/bb/data.py
parentc6798b431571aae18bb8699ac6e3ec75b731d719 (diff)
downloadbitbake-contrib-702b42a47904f2378dd819e7463b3206883c2651.tar.gz
data: Move warning code to the first loop for performance
By doing this we can take advantage of the expansion cache before starting write operations on the data store. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/data.py')
-rw-r--r--lib/bb/data.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/bb/data.py b/lib/bb/data.py
index 82eefef1a..218998a0a 100644
--- a/lib/bb/data.py
+++ b/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:
+ val = alterdata.getVar(key, 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))
# These two for loops are split for performance to maximise the
# usefulness of the expand cache
for key in todolist:
ekey = todolist[key]
- newval = alterdata.getVar(ekey, 0)
- if newval:
- val = alterdata.getVar(key, 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):