aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-02-19 15:21:33 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-05-10 12:27:13 +0300
commitf2d3f3a9b71c2de5c7dfb219dbe690705e595e1c (patch)
tree2287877bb3f808b1055f1487c512dceeb776764b
parent6e6cfb5ae0f9dae866c4a407a6a381d85b2608b9 (diff)
downloadopenembedded-core-contrib-f2d3f3a9b71c2de5c7dfb219dbe690705e595e1c.tar.gz
openembedded-core-contrib-f2d3f3a9b71c2de5c7dfb219dbe690705e595e1c.tar.bz2
openembedded-core-contrib-f2d3f3a9b71c2de5c7dfb219dbe690705e595e1c.zip
SignatureGenerator: make checksum_cache arg of get_taskhash() mandatory
Drop support for the "old" API. Now anyone extending SignatureGenerator by overriding get_taskhash() has to use the new function prototype. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r--lib/bb/runqueue.py28
-rw-r--r--lib/bb/siggen.py9
2 files changed, 10 insertions, 27 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 73567408c1a..27bf6893cfc 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -231,16 +231,10 @@ class RunQueueData:
self.stampwhitelist = cfgData.getVar("BB_STAMP_WHITELIST", True) or ""
self.multi_provider_whitelist = (cfgData.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split()
- # Check if get_taskhash implements the new API. If so, use our own file
- # checksum cache
- self.checksum_cache = None
- if 'checksum_cache' in inspect.getargspec(bb.parse.siggen.get_taskhash).args:
- checksum_cache_file = cfgData.getVar("BB_HASH_CHECKSUM_CACHE_FILE", True)
- self.checksum_cache = FileChecksumCache()
- self.checksum_cache.init_cache(cfgData, checksum_cache_file)
- else:
- logger.warn("%s implements deprecated API of get_taskhash(), "
- "missing the 'checksum_cache' argument" % bb.parse.siggen.__class__.__name__)
+ checksum_cache_file = cfgData.getVar("BB_HASH_CHECKSUM_CACHE_FILE", True)
+ self.checksum_cache = FileChecksumCache()
+ self.checksum_cache.init_cache(cfgData, checksum_cache_file)
+
self.reset()
def reset(self):
@@ -908,18 +902,10 @@ class RunQueueData:
procdep = []
for dep in self.runq_depends[task]:
procdep.append(self.taskData.fn_index[self.runq_fnid[dep]] + "." + self.runq_task[dep])
- if self.checksum_cache:
- self.runq_hash[task] = bb.parse.siggen.get_taskhash(self.taskData.fn_index[self.runq_fnid[task]], self.runq_task[task], procdep, self.dataCache, self.checksum_cache)
- else:
- self.runq_hash[task] = bb.parse.siggen.get_taskhash(self.taskData.fn_index[self.runq_fnid[task]], self.runq_task[task], procdep, self.dataCache)
+ self.runq_hash[task] = bb.parse.siggen.get_taskhash(self.taskData.fn_index[self.runq_fnid[task]], self.runq_task[task], procdep, self.dataCache, self.checksum_cache)
# Write out checksum cache onto disk
- if self.checksum_cache:
- self.checksum_cache.save_extras()
- self.checksum_cache.save_merge()
- else:
- # This relies on the "knowledge" that siggen uses cache of bb.fetch2
- bb.fetch2.fetcher_parse_save()
- bb.fetch2.fetcher_parse_done()
+ self.checksum_cache.save_extras()
+ self.checksum_cache.save_merge()
return len(self.runq_fnid)
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index 81b42d12f3e..182ce62a76d 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -43,7 +43,7 @@ class SignatureGenerator(object):
def finalise(self, fn, d, varient):
return
- def get_taskhash(self, fn, task, deps, dataCache, checksum_cache=None):
+ def get_taskhash(self, fn, task, deps, dataCache, checksum_cache):
return "0"
def stampfile(self, stampbase, file_name, taskname, extrainfo):
@@ -173,7 +173,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
pass
return taint
- def get_taskhash(self, fn, task, deps, dataCache, checksum_cache=None):
+ def get_taskhash(self, fn, task, deps, dataCache, checksum_cache):
k = fn + "." + task
data = dataCache.basetaskhash[k]
self.runtaskdeps[k] = []
@@ -190,10 +190,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
self.runtaskdeps[k].append(dep)
if task in dataCache.file_checksums[fn]:
- if checksum_cache:
- checksums = checksum_cache.get_checksums(dataCache.file_checksums[fn][task], recipename)
- else:
- checksums = bb.fetch2.get_file_checksums(dataCache.file_checksums[fn][task], recipename)
+ checksums = checksum_cache.get_checksums(dataCache.file_checksums[fn][task], recipename)
for (f,cs) in checksums:
self.file_checksum_values[k].append((f,cs))
if cs: