[oe-commits] [bitbake] 03/05: siggen: Ensure taskhash mismatches don't override existing data

git at git.openembedded.org git at git.openembedded.org
Thu May 18 12:14:57 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch 1.30
in repository bitbake.

commit 03f6025a5b0cc4d883a9b2071e026769330752c8
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed Nov 2 15:07:33 2016 +0000

    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: dac68af6f4add9c99cb7adcf23b2ae89b96ca075)
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
    
    Minor fixup
    Signed-off-by: Armin Kuster <akuster808 at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/siggen.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index 7d72f0c..6a903b2 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -287,6 +287,15 @@ class SignatureGeneratorBasic(SignatureGenerator):
             if 'nostamp:' in self.taints[k]:
                 data['taint'] = self.taints[k]
 
+        computed_basehash = calc_basehash(data)
+        if computed_basehash != self.basehash[k]:
+            bb.error("Basehash mismatch %s versus %s for %s" % (computed_basehash, self.basehash[k], k))
+        if runtime and k in self.taskhash:
+            computed_taskhash = calc_taskhash(data)
+            if computed_taskhash != self.taskhash[k]:
+                bb.error("Taskhash mismatch %s versus %s for %s" % (computed_taskhash, self.taskhash[k], k))
+                sigfile = sigfile.replace(self.taskhash[k], computed_taskhash)
+
         fd, tmpfile = tempfile.mkstemp(dir=os.path.dirname(sigfile), prefix="sigtask.")
         try:
             with os.fdopen(fd, "wb") as stream:
@@ -301,15 +310,6 @@ class SignatureGeneratorBasic(SignatureGenerator):
                 pass
             raise err
 
-        computed_basehash = calc_basehash(data)
-        if computed_basehash != self.basehash[k]:
-            bb.error("Basehash mismatch %s verses %s for %s" % (computed_basehash, self.basehash[k], k))
-        if k in self.taskhash:
-            computed_taskhash = calc_taskhash(data)
-            if computed_taskhash != self.taskhash[k]:
-                bb.error("Taskhash mismatch %s verses %s for %s" % (computed_taskhash, self.taskhash[k], k))
-
-
     def dump_sigs(self, dataCache, options):
         for fn in self.taskdeps:
             for task in self.taskdeps[fn]:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list