diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-11-02 15:07:33 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-11-04 12:50:55 +0000 |
commit | 589f08aa852dd43af5d05d698cfa917bec084210 (patch) | |
tree | 1ffc6a876c1f4499bcd8ea61d65f05bc8fe4bd0f /bitbake/lib/bb/siggen.py | |
parent | 0a4a6d6956a10aa0a6589de12b0b2380a9f0a7d9 (diff) | |
download | poky-589f08aa852dd43af5d05d698cfa917bec084210.tar.gz |
bitbake: siggen: Ensure taskhash mismatches don't override existing data
We recalculate the taskhash to ensure the version we have matches
what we think it should be. When we write out a sigdata file, use
the calculated value so that we don't overwrite any existing file.
This leaves any original taskhash sigdata file intact to allow a
debugging comparison.
(Bitbake rev: 291353b711670ce2da3d45617fc96520bdf09d3f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/siggen.py')
-rw-r--r-- | bitbake/lib/bb/siggen.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index 9485bf5d8a..c1685a9e46 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py | |||
@@ -283,6 +283,15 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
283 | if 'nostamp:' in self.taints[k]: | 283 | if 'nostamp:' in self.taints[k]: |
284 | data['taint'] = self.taints[k] | 284 | data['taint'] = self.taints[k] |
285 | 285 | ||
286 | computed_basehash = calc_basehash(data) | ||
287 | if computed_basehash != self.basehash[k]: | ||
288 | bb.error("Basehash mismatch %s versus %s for %s" % (computed_basehash, self.basehash[k], k)) | ||
289 | if runtime and k in self.taskhash: | ||
290 | computed_taskhash = calc_taskhash(data) | ||
291 | if computed_taskhash != self.taskhash[k]: | ||
292 | bb.error("Taskhash mismatch %s versus %s for %s" % (computed_taskhash, self.taskhash[k], k)) | ||
293 | sigfile = sigfile.replace(self.taskhash[k], computed_taskhash) | ||
294 | |||
286 | fd, tmpfile = tempfile.mkstemp(dir=os.path.dirname(sigfile), prefix="sigtask.") | 295 | fd, tmpfile = tempfile.mkstemp(dir=os.path.dirname(sigfile), prefix="sigtask.") |
287 | try: | 296 | try: |
288 | with os.fdopen(fd, "wb") as stream: | 297 | with os.fdopen(fd, "wb") as stream: |
@@ -297,15 +306,6 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
297 | pass | 306 | pass |
298 | raise err | 307 | raise err |
299 | 308 | ||
300 | computed_basehash = calc_basehash(data) | ||
301 | if computed_basehash != self.basehash[k]: | ||
302 | bb.error("Basehash mismatch %s versus %s for %s" % (computed_basehash, self.basehash[k], k)) | ||
303 | if runtime and k in self.taskhash: | ||
304 | computed_taskhash = calc_taskhash(data) | ||
305 | if computed_taskhash != self.taskhash[k]: | ||
306 | bb.error("Taskhash mismatch %s versus %s for %s" % (computed_taskhash, self.taskhash[k], k)) | ||
307 | |||
308 | |||
309 | def dump_sigs(self, dataCaches, options): | 309 | def dump_sigs(self, dataCaches, options): |
310 | for fn in self.taskdeps: | 310 | for fn in self.taskdeps: |
311 | for task in self.taskdeps[fn]: | 311 | for task in self.taskdeps[fn]: |