diff options
-rw-r--r-- | bitbake/lib/bb/cache.py | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index 93dccf21f1..3edd80ec3b 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py | |||
@@ -402,22 +402,15 @@ class Cache(object): | |||
402 | logger.debug(2, "Cache is clean, not saving.") | 402 | logger.debug(2, "Cache is clean, not saving.") |
403 | return | 403 | return |
404 | 404 | ||
405 | version_data = {} | 405 | version_data = { |
406 | version_data['CACHE_VER'] = __cache_version__ | 406 | 'CACHE_VER': __cache_version__, |
407 | version_data['BITBAKE_VER'] = bb.__version__ | 407 | 'BITBAKE_VER': bb.__version__, |
408 | 408 | } | |
409 | cache_data = dict(self.depends_cache) | 409 | |
410 | for fn, info in self.depends_cache.iteritems(): | 410 | with open(self.cachefile, "wb") as cachefile: |
411 | if info.nocache: | 411 | pickle.Pickler(cachefile, -1).dump([self.depends_cache, |
412 | logger.debug(2, "Not caching %s, marked as not cacheable", fn) | 412 | version_data]) |
413 | del cache_data[fn] | 413 | |
414 | elif info.pv and 'SRCREVINACTION' in info.pv: | ||
415 | logger.error("Not caching %s as it had SRCREVINACTION in PV. " | ||
416 | "Please report this bug", fn) | ||
417 | del cache_data[fn] | ||
418 | |||
419 | p = pickle.Pickler(file(self.cachefile, "wb"), -1) | ||
420 | p.dump([cache_data, version_data]) | ||
421 | del self.depends_cache | 414 | del self.depends_cache |
422 | 415 | ||
423 | @staticmethod | 416 | @staticmethod |
@@ -425,13 +418,11 @@ class Cache(object): | |||
425 | return bb.parse.cached_mtime_noerror(cachefile) | 418 | return bb.parse.cached_mtime_noerror(cachefile) |
426 | 419 | ||
427 | def add_info(self, filename, info, cacheData, parsed=None): | 420 | def add_info(self, filename, info, cacheData, parsed=None): |
428 | self.depends_cache[filename] = info | ||
429 | cacheData.add_from_recipeinfo(filename, info) | 421 | cacheData.add_from_recipeinfo(filename, info) |
430 | if parsed and not info.nocache: | 422 | if 'SRCREVINACTION' not in info.pv and not info.nocache: |
431 | # The recipe was parsed, and is not marked as being | 423 | if parsed: |
432 | # uncacheable, so we need to ensure that we write out the | 424 | self.cacheclean = False |
433 | # new cache data. | 425 | self.depends_cache[filename] = info |
434 | self.cacheclean = False | ||
435 | 426 | ||
436 | def add(self, file_name, data, cacheData, parsed=None): | 427 | def add(self, file_name, data, cacheData, parsed=None): |
437 | """ | 428 | """ |