[bitbake-devel] [PATCH] siggen: Fixes to handle sigdata/siginfo files only containing basehash data

Richard Purdie richard.purdie at linuxfoundation.org
Mon May 16 21:51:08 UTC 2016


The signature data file comparison functions are meant to be able to
handle data files containing just the base hash data. This had regressed
in some places so add fixes to allow these comparisons to be made. The
runtime components in the data files are optional.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 7f29c62..d48dcdf 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -295,7 +295,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
         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:
+        if runtime and 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))
@@ -449,6 +449,11 @@ def compare_sigfiles(a, b, recursecb = None):
         for dep in changed:
             output.append("Variable %s value changed from '%s' to '%s'" % (dep, a_data['varvals'][dep], b_data['varvals'][dep]))
 
+    if not 'file_checksum_values' in a_data:
+         a_data['file_checksum_values'] = {}
+    if not 'file_checksum_values' in b_data:
+         b_data['file_checksum_values'] = {}
+
     changed, added, removed = file_checksums_diff(a_data['file_checksum_values'], b_data['file_checksum_values'])
     if changed:
         for f, old, new in changed:
@@ -460,6 +465,10 @@ def compare_sigfiles(a, b, recursecb = None):
         for f in removed:
             output.append("Dependency on checksum of file %s was removed" % (f))
 
+    if not 'runtaskdeps' in a_data:
+         a_data['runtaskdeps'] = {}
+    if not 'runtaskdeps' in b_data:
+         b_data['runtaskdeps'] = {}
 
     if len(a_data['runtaskdeps']) != len(b_data['runtaskdeps']):
         changed = ["Number of task dependencies changed"]





More information about the bitbake-devel mailing list