summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-16 07:51:18 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-17 14:11:04 +0100
commitd7e7b991ce42439e2df8531859fafcd4a91f2ed9 (patch)
tree7c67d6a23a913ef3db8cadecacd67226310317f8 /bitbake
parentd6ac67f9afbd431ed308d6513730217cce0d689d (diff)
downloadpoky-d7e7b991ce42439e2df8531859fafcd4a91f2ed9.tar.gz
poky-d7e7b991ce42439e2df8531859fafcd4a91f2ed9.tar.bz2
poky-d7e7b991ce42439e2df8531859fafcd4a91f2ed9.zip
bitbake: data: Optimise build_dependencies a little
Instead of multiple calls to getVarFlag, make one call to getVarFlags, only expanding the flags that need to be expanded. This improves performance. (Bitbake rev: eba1e9545cc933820d40de96f023b2307b3c4d0b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/data.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index ecac66c6ba..876f6ca542 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -287,18 +287,19 @@ def update_data(d):
def build_dependencies(key, keys, shelldeps, vardepvals, d):
deps = set()
- vardeps = d.getVarFlag(key, "vardeps", True)
try:
if key[-1] == ']':
vf = key[:-1].split('[')
value = d.getVarFlag(vf[0], vf[1], False)
else:
value = d.getVar(key, False)
+ varflags = d.getVarFlags(key, ["vardeps", "vardepvalue", "vardepsexclude"]) or {}
+ vardeps = varflags.get("vardeps")
- if key in vardepvals:
- value = d.getVarFlag(key, "vardepvalue", True)
- elif d.getVarFlag(key, "func"):
- if d.getVarFlag(key, "python"):
+ if "vardepvalue" in varflags:
+ value = varflags.get("vardepvalue")
+ elif varflags.get("func"):
+ if varflags.get("python"):
parsedvar = d.expandWithRefs(value, key)
parser = bb.codeparser.PythonParser(key, logger)
if parsedvar.value and "\t" in parsedvar.value:
@@ -323,16 +324,14 @@ def build_dependencies(key, keys, shelldeps, vardepvals, d):
varflagsexcl = d.getVar('BB_SIGNATURE_EXCLUDE_FLAGS', True)
if varflagsexcl:
varfdeps = []
- varflags = d.getVarFlags(key)
- if varflags:
- for f in varflags:
- if f not in varflagsexcl:
- varfdeps.append('%s[%s]' % (key, f))
+ for f in varflags:
+ if f not in varflagsexcl:
+ varfdeps.append('%s[%s]' % (key, f))
if varfdeps:
deps |= set(varfdeps)
deps |= set((vardeps or "").split())
- deps -= set((d.getVarFlag(key, "vardepsexclude", True) or "").split())
+ deps -= set(varflags.get("vardepsexclude", "").split())
except Exception as e:
raise bb.data_smart.ExpansionError(key, None, e)
return deps, value