Skip to contentSkip to conversation

siggen: Ensure we output if the ordering of runtaskdeps changes

PATCH New Richard Purdie 1 participant 1 message Nov 7, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 siggen: Ensure we output if the ordering of runtaskdeps changes

Order of runtaskdeps is important. If the hashes differ we should print output. This is complicated by shared work where the filenames themselves can differ, but the checksum should not.

This fixes a case where two different checksums could show no output with bitbake-diffsigs.

bitbake/lib/bb/siggen.py +17 -0
index 86d9ca0..1033785 100644
@@ -307,6 +307,12 @@ def clean_basepaths(a):
         b[clean_basepath(x)] = a[x]
     return b
 
+def clean_basepaths_list(a):
+    b = []
+    for x in a:
+        b.append(clean_basepath(x))
+    return b
+
 def compare_sigfiles(a, b, recursecb = None):
     output = []
 
@@ -406,6 +412,17 @@ def compare_sigfiles(a, b, recursecb = None):
         for f in removed:
             output.append("Dependency on checksum of file %s was removed" % (f))
 
+    changed = []
+    for idx, task in enumerate(a_data['runtaskdeps']):
+        a = a_data['runtaskdeps'][idx]
+        b = b_data['runtaskdeps'][idx]
+        if a_data['runtaskhashes'][a] != b_data['runtaskhashes'][b]:
+            changed.append("%s with hash %s\n changed to\n%s with hash %s" % (a, a_data['runtaskhashes'][a], b, b_data['runtaskhashes'][b]))
+
+    if changed:
+        output.append("runtaskdeps changed from %s to %s" % (clean_basepaths_list(a_data['runtaskdeps']), clean_basepaths_list(b_data['runtaskdeps'])))
+        output.append("\n".join(changed))
+
 
     if 'runtaskhashes' in a_data and 'runtaskhashes' in b_data:
         a = a_data['runtaskhashes']