summaryrefslogtreecommitdiffstats
path: root/lib/bb/cache.py
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-06-04 14:04:40 +0200
committerChris Larson <chris_larson@mentor.com>2010-06-04 16:27:48 -0700
commitf7c69462b8ba726861898817cc5b13174c78e35a (patch)
treee7dcdac2bde329e96920cf3999385d7f0bbbab65 /lib/bb/cache.py
parentc0cf85beda4cf8748fd270c037442cde7b98146b (diff)
downloadopenembedded-core-contrib-f7c69462b8ba726861898817cc5b13174c78e35a.tar.gz
cache: use a set() for __depends
to make updating depends easier/more intuitive/eventually faster Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/cache.py')
-rw-r--r--lib/bb/cache.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/bb/cache.py b/lib/bb/cache.py
index 8c1e6922fb..59ea8cfc7b 100644
--- a/lib/bb/cache.py
+++ b/lib/bb/cache.py
@@ -106,8 +106,7 @@ class Cache:
if fn in self.clean:
return self.depends_cache[fn][var]
- if not fn in self.depends_cache:
- self.depends_cache[fn] = {}
+ self.depends_cache.setdefault(fn, {})
if fn != self.data_fn:
# We're trying to access data in the cache which doesn't exist
@@ -131,13 +130,12 @@ class Cache:
# Make sure __depends makes the depends_cache
# If we're a virtual class we need to make sure all our depends are appended
# to the depends of fn.
- depends = self.getVar("__depends", virtualfn) or []
+ depends = self.getVar("__depends", virtualfn) or set()
self.depends_cache.setdefault(fn, {})
if "__depends" not in self.depends_cache[fn] or not self.depends_cache[fn]["__depends"]:
self.depends_cache[fn]["__depends"] = depends
- for dep in depends:
- if dep not in self.depends_cache[fn]["__depends"]:
- self.depends_cache[fn]["__depends"].append(dep)
+ else:
+ self.depends_cache[fn]["__depends"].update(depends)
# Make sure the variants always make it into the cache too
self.getVar('__VARIANTS', virtualfn, True)