summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cache.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/cache.py')
-rw-r--r--bitbake/lib/bb/cache.py89
1 files changed, 44 insertions, 45 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index d30d57d33b..2f1b8fa601 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -134,7 +134,18 @@ class Cache:
134 self.data = data 134 self.data = data
135 135
136 # Make sure __depends makes the depends_cache 136 # Make sure __depends makes the depends_cache
137 self.getVar("__depends", virtualfn, True) 137 # If we're a virtual class we need to make sure all our depends are appended
138 # to the depends of fn.
139 depends = self.getVar("__depends", virtualfn, True) or []
140 if "__depends" not in self.depends_cache[fn] or not self.depends_cache[fn]["__depends"]:
141 self.depends_cache[fn]["__depends"] = depends
142 for dep in depends:
143 if dep not in self.depends_cache[fn]["__depends"]:
144 self.depends_cache[fn]["__depends"].append(dep)
145
146 # Make sure BBCLASSEXTEND always makes the cache too
147 self.getVar('BBCLASSEXTEND', virtualfn, True)
148
138 self.depends_cache[virtualfn]["CACHETIMESTAMP"] = bb.parse.cached_mtime(fn) 149 self.depends_cache[virtualfn]["CACHETIMESTAMP"] = bb.parse.cached_mtime(fn)
139 150
140 def virtualfn2realfn(self, virtualfn): 151 def virtualfn2realfn(self, virtualfn):
@@ -170,11 +181,8 @@ class Cache:
170 181
171 bb.msg.debug(1, bb.msg.domain.Cache, "Parsing %s (full)" % fn) 182 bb.msg.debug(1, bb.msg.domain.Cache, "Parsing %s (full)" % fn)
172 183
173 bb_data, skipped = self.load_bbfile(fn, cfgData) 184 bb_data = self.load_bbfile(fn, cfgData)
174 if isinstance(bb_data, dict): 185 return bb_data[cls]
175 return bb_data[cls]
176
177 return bb_data
178 186
179 def loadData(self, fn, cfgData, cacheData): 187 def loadData(self, fn, cfgData, cacheData):
180 """ 188 """
@@ -184,42 +192,39 @@ class Cache:
184 to record the variables accessed. 192 to record the variables accessed.
185 Return the cache status and whether the file was skipped when parsed 193 Return the cache status and whether the file was skipped when parsed
186 """ 194 """
195 skipped = 0
196 virtuals = 0
197
187 if fn not in self.checked: 198 if fn not in self.checked:
188 self.cacheValidUpdate(fn) 199 self.cacheValidUpdate(fn)
200
189 if self.cacheValid(fn): 201 if self.cacheValid(fn):
190 if "SKIPPED" in self.depends_cache[fn]:
191 return True, True
192 self.handle_data(fn, cacheData)
193 multi = self.getVar('BBCLASSEXTEND', fn, True) 202 multi = self.getVar('BBCLASSEXTEND', fn, True)
194 if multi: 203 for cls in (multi or "").split() + [""]:
195 for cls in multi.split(): 204 virtualfn = self.realfn2virtual(fn, cls)
196 virtualfn = self.realfn2virtual(fn, cls) 205 if self.depends_cache[virtualfn]["__SKIPPED"]:
197 # Pretend we're clean so getVar works 206 skipped += 1
198 self.clean[virtualfn] = "" 207 bb.msg.debug(1, bb.msg.domain.Cache, "Skipping %s" % virtualfn)
199 self.handle_data(virtualfn, cacheData) 208 continue
200 return True, False 209 self.handle_data(virtualfn, cacheData)
210 virtuals += 1
211 return True, skipped, virtuals
201 212
202 bb.msg.debug(1, bb.msg.domain.Cache, "Parsing %s" % fn) 213 bb.msg.debug(1, bb.msg.domain.Cache, "Parsing %s" % fn)
203 214
204 bb_data, skipped = self.load_bbfile(fn, cfgData) 215 bb_data = self.load_bbfile(fn, cfgData)
205
206 if skipped:
207 if isinstance(bb_data, dict):
208 self.setData(fn, fn, bb_data[""])
209 else:
210 self.setData(fn, fn, bb_data)
211 return False, skipped
212 216
213 if isinstance(bb_data, dict): 217 for data in bb_data:
214 for data in bb_data: 218 virtualfn = self.realfn2virtual(fn, data)
215 virtualfn = self.realfn2virtual(fn, data) 219 self.setData(virtualfn, fn, bb_data[data])
216 self.setData(virtualfn, fn, bb_data[data]) 220 if self.getVar("__SKIPPED", virtualfn, True):
221 skipped += 1
222 bb.msg.debug(1, bb.msg.domain.Cache, "Skipping %s" % virtualfn)
223 else:
217 self.handle_data(virtualfn, cacheData) 224 self.handle_data(virtualfn, cacheData)
218 return False, skipped 225 virtuals += 1
226 return False, skipped, virtuals
219 227
220 self.setData(fn, fn, bb_data)
221 self.handle_data(fn, cacheData)
222 return False, skipped
223 228
224 def cacheValid(self, fn): 229 def cacheValid(self, fn):
225 """ 230 """
@@ -286,16 +291,13 @@ class Cache:
286 if not fn in self.clean: 291 if not fn in self.clean:
287 self.clean[fn] = "" 292 self.clean[fn] = ""
288 293
289 return True 294 # Mark extended class data as clean too
295 multi = self.getVar('BBCLASSEXTEND', fn, True)
296 for cls in (multi or "").split():
297 virtualfn = self.realfn2virtual(fn, cls)
298 self.clean[virtualfn] = ""
290 299
291 def skip(self, fn): 300 return True
292 """
293 Mark a fn as skipped
294 Called from the parser
295 """
296 if not fn in self.depends_cache:
297 self.depends_cache[fn] = {}
298 self.depends_cache[fn]["SKIPPED"] = "1"
299 301
300 def remove(self, fn): 302 def remove(self, fn):
301 """ 303 """
@@ -462,10 +464,7 @@ class Cache:
462 try: 464 try:
463 bb_data = parse.handle(bbfile, bb_data) # read .bb data 465 bb_data = parse.handle(bbfile, bb_data) # read .bb data
464 os.chdir(oldpath) 466 os.chdir(oldpath)
465 return bb_data, False 467 return bb_data
466 except bb.parse.SkipPackage:
467 os.chdir(oldpath)
468 return bb_data, True
469 except: 468 except:
470 os.chdir(oldpath) 469 os.chdir(oldpath)
471 raise 470 raise