diff options
| author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2010-06-04 14:04:40 +0200 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-07-02 15:41:35 +0100 |
| commit | 30216c65e59e7072bed5001598240dcc58017940 (patch) | |
| tree | bbbe00b0888b3e8f6ef00b449444b1d70a19a316 /bitbake/lib/bb/cache.py | |
| parent | cf79cf127b370160b59e088acec187b0f0212e7f (diff) | |
| download | poky-30216c65e59e7072bed5001598240dcc58017940.tar.gz | |
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>
Diffstat (limited to 'bitbake/lib/bb/cache.py')
| -rw-r--r-- | bitbake/lib/bb/cache.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index 8c1e6922fb..59ea8cfc7b 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py | |||
| @@ -106,8 +106,7 @@ class Cache: | |||
| 106 | if fn in self.clean: | 106 | if fn in self.clean: |
| 107 | return self.depends_cache[fn][var] | 107 | return self.depends_cache[fn][var] |
| 108 | 108 | ||
| 109 | if not fn in self.depends_cache: | 109 | self.depends_cache.setdefault(fn, {}) |
| 110 | self.depends_cache[fn] = {} | ||
| 111 | 110 | ||
| 112 | if fn != self.data_fn: | 111 | if fn != self.data_fn: |
| 113 | # We're trying to access data in the cache which doesn't exist | 112 | # We're trying to access data in the cache which doesn't exist |
| @@ -131,13 +130,12 @@ class Cache: | |||
| 131 | # Make sure __depends makes the depends_cache | 130 | # Make sure __depends makes the depends_cache |
| 132 | # If we're a virtual class we need to make sure all our depends are appended | 131 | # If we're a virtual class we need to make sure all our depends are appended |
| 133 | # to the depends of fn. | 132 | # to the depends of fn. |
| 134 | depends = self.getVar("__depends", virtualfn) or [] | 133 | depends = self.getVar("__depends", virtualfn) or set() |
| 135 | self.depends_cache.setdefault(fn, {}) | 134 | self.depends_cache.setdefault(fn, {}) |
| 136 | if "__depends" not in self.depends_cache[fn] or not self.depends_cache[fn]["__depends"]: | 135 | if "__depends" not in self.depends_cache[fn] or not self.depends_cache[fn]["__depends"]: |
| 137 | self.depends_cache[fn]["__depends"] = depends | 136 | self.depends_cache[fn]["__depends"] = depends |
| 138 | for dep in depends: | 137 | else: |
| 139 | if dep not in self.depends_cache[fn]["__depends"]: | 138 | self.depends_cache[fn]["__depends"].update(depends) |
| 140 | self.depends_cache[fn]["__depends"].append(dep) | ||
| 141 | 139 | ||
| 142 | # Make sure the variants always make it into the cache too | 140 | # Make sure the variants always make it into the cache too |
| 143 | self.getVar('__VARIANTS', virtualfn, True) | 141 | self.getVar('__VARIANTS', virtualfn, True) |
