summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-16 07:54:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-17 14:11:05 +0100
commitd15652d78c2e6c3af4658726711332c1ee127427 (patch)
tree0ecc5c623cf135da09edbf1794439000fa66aa66
parent9a32eca022ece59a799a94d54d350cdc5a13eef1 (diff)
downloadpoky-d15652d78c2e6c3af4658726711332c1ee127427.tar.gz
bitbake: data: Optimise flag exclusion list handling
Move the variable lookup to the outer loop for performance, replacing a now unneeded parameter (after the previous changes). (Bitbake rev: 8a59a8707cecbde257fca169775ce8ff7709928b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/data.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index 49bb5e997d..349fcfe878 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -285,7 +285,7 @@ def update_data(d):
285 """Performs final steps upon the datastore, including application of overrides""" 285 """Performs final steps upon the datastore, including application of overrides"""
286 d.finalize(parent = True) 286 d.finalize(parent = True)
287 287
288def build_dependencies(key, keys, shelldeps, vardepvals, d): 288def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
289 deps = set() 289 deps = set()
290 try: 290 try:
291 if key[-1] == ']': 291 if key[-1] == ']':
@@ -324,7 +324,6 @@ def build_dependencies(key, keys, shelldeps, vardepvals, d):
324 deps = deps | (keys & parser.execs) 324 deps = deps | (keys & parser.execs)
325 325
326 # Add varflags, assuming an exclusion list is set 326 # Add varflags, assuming an exclusion list is set
327 varflagsexcl = d.getVar('BB_SIGNATURE_EXCLUDE_FLAGS', True)
328 if varflagsexcl: 327 if varflagsexcl:
329 varfdeps = [] 328 varfdeps = []
330 for f in varflags: 329 for f in varflags:
@@ -345,14 +344,14 @@ def generate_dependencies(d):
345 344
346 keys = set(key for key in d if not key.startswith("__")) 345 keys = set(key for key in d if not key.startswith("__"))
347 shelldeps = set(key for key in d.getVar("__exportlist", False) if d.getVarFlag(key, "export") and not d.getVarFlag(key, "unexport")) 346 shelldeps = set(key for key in d.getVar("__exportlist", False) if d.getVarFlag(key, "export") and not d.getVarFlag(key, "unexport"))
348 vardepvals = set(key for key in keys if d.getVarFlag(key, "vardepvalue")) 347 varflagsexcl = d.getVar('BB_SIGNATURE_EXCLUDE_FLAGS', True)
349 348
350 deps = {} 349 deps = {}
351 values = {} 350 values = {}
352 351
353 tasklist = d.getVar('__BBTASKS') or [] 352 tasklist = d.getVar('__BBTASKS') or []
354 for task in tasklist: 353 for task in tasklist:
355 deps[task], values[task] = build_dependencies(task, keys, shelldeps, vardepvals, d) 354 deps[task], values[task] = build_dependencies(task, keys, shelldeps, varflagsexcl, d)
356 newdeps = deps[task] 355 newdeps = deps[task]
357 seen = set() 356 seen = set()
358 while newdeps: 357 while newdeps:
@@ -361,7 +360,7 @@ def generate_dependencies(d):
361 newdeps = set() 360 newdeps = set()
362 for dep in nextdeps: 361 for dep in nextdeps:
363 if dep not in deps: 362 if dep not in deps:
364 deps[dep], values[dep] = build_dependencies(dep, keys, shelldeps, vardepvals, d) 363 deps[dep], values[dep] = build_dependencies(dep, keys, shelldeps, varflagsexcl, d)
365 newdeps |= deps[dep] 364 newdeps |= deps[dep]
366 newdeps -= seen 365 newdeps -= seen
367 #print "For %s: %s" % (task, str(deps[task])) 366 #print "For %s: %s" % (task, str(deps[task]))