summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cache.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-06 17:54:49 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-07 10:57:42 +0100
commit159aee22dc7d8c78ca2920dfc58d8bf9238ef720 (patch)
tree88efc1c0ae9ceeb176f21889119bd918ecef9af0 /bitbake/lib/bb/cache.py
parentd4132fa12885fc050313a5c9aa6903e4fa92c94f (diff)
downloadpoky-159aee22dc7d8c78ca2920dfc58d8bf9238ef720.tar.gz
cache.py: Ensure additional .bbappend files are accounted for
Currently if a user adds a new .bbappend file to the system, the cache still thinks the cached data is valid. This code fixes that to ensure additions and changed in append application order are accounted for. [YOCTO #1091] (Bitbake rev: 54fe91fe96aaae47c40077c5f441c79da71da777) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cache.py')
-rw-r--r--bitbake/lib/bb/cache.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index 99d7395f86..6e152fa0c9 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -43,7 +43,7 @@ except ImportError:
43 logger.info("Importing cPickle failed. " 43 logger.info("Importing cPickle failed. "
44 "Falling back to a very slow implementation.") 44 "Falling back to a very slow implementation.")
45 45
46__cache_version__ = "140" 46__cache_version__ = "141"
47 47
48def getCacheFile(path, filename): 48def getCacheFile(path, filename):
49 return os.path.join(path, filename) 49 return os.path.join(path, filename)
@@ -94,6 +94,7 @@ class CoreRecipeInfo(RecipeInfoCommon):
94 self.file_depends = metadata.getVar('__depends', False) 94 self.file_depends = metadata.getVar('__depends', False)
95 self.timestamp = bb.parse.cached_mtime(filename) 95 self.timestamp = bb.parse.cached_mtime(filename)
96 self.variants = self.listvar('__VARIANTS', metadata) + [''] 96 self.variants = self.listvar('__VARIANTS', metadata) + ['']
97 self.appends = self.listvar('__BBAPPEND', metadata)
97 self.nocache = self.getvar('__BB_DONT_CACHE', metadata) 98 self.nocache = self.getvar('__BB_DONT_CACHE', metadata)
98 99
99 self.skipreason = self.getvar('__SKIPPED', metadata) 100 self.skipreason = self.getvar('__SKIPPED', metadata)
@@ -429,7 +430,7 @@ class Cache(object):
429 automatically add the information to the cache or to your 430 automatically add the information to the cache or to your
430 CacheData. Use the add or add_info method to do so after 431 CacheData. Use the add or add_info method to do so after
431 running this, or use loadData instead.""" 432 running this, or use loadData instead."""
432 cached = self.cacheValid(filename) 433 cached = self.cacheValid(filename, appends)
433 if cached: 434 if cached:
434 infos = [] 435 infos = []
435 # info_array item is a list of [CoreRecipeInfo, XXXRecipeInfo] 436 # info_array item is a list of [CoreRecipeInfo, XXXRecipeInfo]
@@ -460,13 +461,13 @@ class Cache(object):
460 461
461 return cached, skipped, virtuals 462 return cached, skipped, virtuals
462 463
463 def cacheValid(self, fn): 464 def cacheValid(self, fn, appends):
464 """ 465 """
465 Is the cache valid for fn? 466 Is the cache valid for fn?
466 Fast version, no timestamps checked. 467 Fast version, no timestamps checked.
467 """ 468 """
468 if fn not in self.checked: 469 if fn not in self.checked:
469 self.cacheValidUpdate(fn) 470 self.cacheValidUpdate(fn, appends)
470 471
471 # Is cache enabled? 472 # Is cache enabled?
472 if not self.has_cache: 473 if not self.has_cache:
@@ -475,7 +476,7 @@ class Cache(object):
475 return True 476 return True
476 return False 477 return False
477 478
478 def cacheValidUpdate(self, fn): 479 def cacheValidUpdate(self, fn, appends):
479 """ 480 """
480 Is the cache valid for fn? 481 Is the cache valid for fn?
481 Make thorough (slower) checks including timestamps. 482 Make thorough (slower) checks including timestamps.
@@ -524,6 +525,12 @@ class Cache(object):
524 self.remove(fn) 525 self.remove(fn)
525 return False 526 return False
526 527
528 if appends != info_array[0].appends:
529 logger.debug(2, "Cache: appends for %s changed", fn)
530 bb.note("%s to %s" % (str(appends), str(info_array[0].appends)))
531 self.remove(fn)
532 return False
533
527 invalid = False 534 invalid = False
528 for cls in info_array[0].variants: 535 for cls in info_array[0].variants:
529 virtualfn = self.realfn2virtual(fn, cls) 536 virtualfn = self.realfn2virtual(fn, cls)