diff options
Diffstat (limited to 'bitbake/lib/bb/cache.py')
-rw-r--r-- | bitbake/lib/bb/cache.py | 54 |
1 files changed, 17 insertions, 37 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index 4d715e911d..22ca6f56e6 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py | |||
@@ -280,7 +280,11 @@ def variant2virtual(realfn, variant): | |||
280 | return "mc:" + elems[1] + ":" + realfn | 280 | return "mc:" + elems[1] + ":" + realfn |
281 | return "virtual:" + variant + ":" + realfn | 281 | return "virtual:" + variant + ":" + realfn |
282 | 282 | ||
283 | 283 | # | |
284 | # Cooker calls cacheValid on its recipe list, then either calls loadCached | ||
285 | # from it's main thread or parse from separate processes to generate an up to | ||
286 | # date cache | ||
287 | # | ||
284 | class Cache(object): | 288 | class Cache(object): |
285 | """ | 289 | """ |
286 | BitBake Cache implementation | 290 | BitBake Cache implementation |
@@ -447,43 +451,19 @@ class Cache(object): | |||
447 | 451 | ||
448 | return infos | 452 | return infos |
449 | 453 | ||
450 | def load(self, filename, appends): | 454 | def loadCached(self, filename, appends): |
451 | """Obtain the recipe information for the specified filename, | 455 | """Obtain the recipe information for the specified filename, |
452 | using cached values if available, otherwise parsing. | 456 | using cached values. |
453 | 457 | """ | |
454 | Note that if it does parse to obtain the info, it will not | 458 | |
455 | automatically add the information to the cache or to your | 459 | infos = [] |
456 | CacheData. Use the add or add_info method to do so after | 460 | # info_array item is a list of [CoreRecipeInfo, XXXRecipeInfo] |
457 | running this, or use loadData instead.""" | 461 | info_array = self.depends_cache[filename] |
458 | cached = self.cacheValid(filename, appends) | 462 | for variant in info_array[0].variants: |
459 | if cached: | 463 | virtualfn = variant2virtual(filename, variant) |
460 | infos = [] | 464 | infos.append((virtualfn, self.depends_cache[virtualfn])) |
461 | # info_array item is a list of [CoreRecipeInfo, XXXRecipeInfo] | 465 | |
462 | info_array = self.depends_cache[filename] | 466 | return infos |
463 | for variant in info_array[0].variants: | ||
464 | virtualfn = variant2virtual(filename, variant) | ||
465 | infos.append((virtualfn, self.depends_cache[virtualfn])) | ||
466 | else: | ||
467 | return self.parse(filename, appends, configdata, self.caches_array) | ||
468 | |||
469 | return cached, infos | ||
470 | |||
471 | def loadData(self, fn, appends, cacheData): | ||
472 | """Load the recipe info for the specified filename, | ||
473 | parsing and adding to the cache if necessary, and adding | ||
474 | the recipe information to the supplied CacheData instance.""" | ||
475 | skipped, virtuals = 0, 0 | ||
476 | |||
477 | cached, infos = self.load(fn, appends) | ||
478 | for virtualfn, info_array in infos: | ||
479 | if info_array[0].skipped: | ||
480 | self.logger.debug("Skipping %s: %s", virtualfn, info_array[0].skipreason) | ||
481 | skipped += 1 | ||
482 | else: | ||
483 | self.add_info(virtualfn, info_array, cacheData, not cached) | ||
484 | virtuals += 1 | ||
485 | |||
486 | return cached, skipped, virtuals | ||
487 | 467 | ||
488 | def cacheValid(self, fn, appends): | 468 | def cacheValid(self, fn, appends): |
489 | """ | 469 | """ |