cache: use a set() for __depends
to make updating depends easier/more intuitive/eventually faster (Bitbake rev: f7c69462b8ba726861898817cc5b13174c78e35a) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
parent
cf79cf127b
commit
30216c65e5
|
@ -106,8 +106,7 @@ class Cache:
|
||||||
if fn in self.clean:
|
if fn in self.clean:
|
||||||
return self.depends_cache[fn][var]
|
return self.depends_cache[fn][var]
|
||||||
|
|
||||||
if not fn in self.depends_cache:
|
self.depends_cache.setdefault(fn, {})
|
||||||
self.depends_cache[fn] = {}
|
|
||||||
|
|
||||||
if fn != self.data_fn:
|
if fn != self.data_fn:
|
||||||
# We're trying to access data in the cache which doesn't exist
|
# 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
|
# Make sure __depends makes the depends_cache
|
||||||
# If we're a virtual class we need to make sure all our depends are appended
|
# If we're a virtual class we need to make sure all our depends are appended
|
||||||
# to the depends of fn.
|
# to the depends of fn.
|
||||||
depends = self.getVar("__depends", virtualfn) or []
|
depends = self.getVar("__depends", virtualfn) or set()
|
||||||
self.depends_cache.setdefault(fn, {})
|
self.depends_cache.setdefault(fn, {})
|
||||||
if "__depends" not in self.depends_cache[fn] or not self.depends_cache[fn]["__depends"]:
|
if "__depends" not in self.depends_cache[fn] or not self.depends_cache[fn]["__depends"]:
|
||||||
self.depends_cache[fn]["__depends"] = depends
|
self.depends_cache[fn]["__depends"] = depends
|
||||||
for dep in depends:
|
else:
|
||||||
if dep not in self.depends_cache[fn]["__depends"]:
|
self.depends_cache[fn]["__depends"].update(depends)
|
||||||
self.depends_cache[fn]["__depends"].append(dep)
|
|
||||||
|
|
||||||
# Make sure the variants always make it into the cache too
|
# Make sure the variants always make it into the cache too
|
||||||
self.getVar('__VARIANTS', virtualfn, True)
|
self.getVar('__VARIANTS', virtualfn, True)
|
||||||
|
|
|
@ -56,8 +56,8 @@ def update_mtime(f):
|
||||||
def mark_dependency(d, f):
|
def mark_dependency(d, f):
|
||||||
if f.startswith('./'):
|
if f.startswith('./'):
|
||||||
f = "%s/%s" % (os.getcwd(), f[2:])
|
f = "%s/%s" % (os.getcwd(), f[2:])
|
||||||
deps = bb.data.getVar('__depends', d) or []
|
deps = bb.data.getVar('__depends', d) or set()
|
||||||
deps.append( (f, cached_mtime(f)) )
|
deps.update([(f, cached_mtime(f))])
|
||||||
bb.data.setVar('__depends', deps, d)
|
bb.data.setVar('__depends', deps, d)
|
||||||
|
|
||||||
def supports(fn, data):
|
def supports(fn, data):
|
||||||
|
|
Loading…
Reference in New Issue