diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-08-27 21:44:35 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-07 12:10:45 +0100 |
commit | e58eb8cbb0f9ecd4afa23ffb64c8467b24d93c5c (patch) | |
tree | 6be029b25e2b74e9338a6932d88168317c7bdb7b /bitbake/lib/bb/siggen.py | |
parent | d5226c96d3c64bcfa8922327594663352703a8a8 (diff) | |
download | poky-e58eb8cbb0f9ecd4afa23ffb64c8467b24d93c5c.tar.gz |
bitbake: bitbake-diffsigs: allow specifying task & follow deps recursively
Add the ability to compare the two most recent runs of a specified task,
and follow dependent hash changes recursively. This enables you to trace
back and find exactly why a task was re-run after the fact.
Note that this relies on the metadata providing a function, hooked in
as bb.siggen.find_siginfo, which allows searching in the appropriate
places to find signature data files.
(Bitbake rev: cc70181659c07e04c205e17832846acf1ff31d28)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
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 | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index 8d1501b8ae..8fe59b9057 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py | |||
@@ -301,7 +301,7 @@ def clean_basepaths(a): | |||
301 | b[clean_basepath(x)] = a[x] | 301 | b[clean_basepath(x)] = a[x] |
302 | return b | 302 | return b |
303 | 303 | ||
304 | def compare_sigfiles(a, b): | 304 | def compare_sigfiles(a, b, recursecb = None): |
305 | output = [] | 305 | output = [] |
306 | 306 | ||
307 | p1 = pickle.Unpickler(open(a, "rb")) | 307 | p1 = pickle.Unpickler(open(a, "rb")) |
@@ -369,8 +369,8 @@ def compare_sigfiles(a, b): | |||
369 | 369 | ||
370 | 370 | ||
371 | if 'runtaskhashes' in a_data and 'runtaskhashes' in b_data: | 371 | if 'runtaskhashes' in a_data and 'runtaskhashes' in b_data: |
372 | a = clean_basepaths(a_data['runtaskhashes']) | 372 | a = a_data['runtaskhashes'] |
373 | b = clean_basepaths(b_data['runtaskhashes']) | 373 | b = b_data['runtaskhashes'] |
374 | changed, added, removed = dict_diff(a, b) | 374 | changed, added, removed = dict_diff(a, b) |
375 | if added: | 375 | if added: |
376 | for dep in added: | 376 | for dep in added: |
@@ -381,7 +381,7 @@ def compare_sigfiles(a, b): | |||
381 | #output.append("Dependency on task %s was replaced by %s with same hash" % (dep, bdep)) | 381 | #output.append("Dependency on task %s was replaced by %s with same hash" % (dep, bdep)) |
382 | bdep_found = True | 382 | bdep_found = True |
383 | if not bdep_found: | 383 | if not bdep_found: |
384 | output.append("Dependency on task %s was added with hash %s" % (dep, a[dep])) | 384 | output.append("Dependency on task %s was added with hash %s" % (clean_basepath(dep), a[dep])) |
385 | if removed: | 385 | if removed: |
386 | for dep in removed: | 386 | for dep in removed: |
387 | adep_found = False | 387 | adep_found = False |
@@ -391,11 +391,14 @@ def compare_sigfiles(a, b): | |||
391 | #output.append("Dependency on task %s was replaced by %s with same hash" % (adep, dep)) | 391 | #output.append("Dependency on task %s was replaced by %s with same hash" % (adep, dep)) |
392 | adep_found = True | 392 | adep_found = True |
393 | if not adep_found: | 393 | if not adep_found: |
394 | output.append("Dependency on task %s was removed with hash %s" % (dep, b[dep])) | 394 | output.append("Dependency on task %s was removed with hash %s" % (clean_basepath(dep), b[dep])) |
395 | if changed: | 395 | if changed: |
396 | for dep in changed: | 396 | for dep in changed: |
397 | output.append("Hash for dependent task %s changed from %s to %s" % (dep, a[dep], b[dep])) | 397 | output.append("Hash for dependent task %s changed from %s to %s" % (clean_basepath(dep), a[dep], b[dep])) |
398 | 398 | if callable(recursecb): | |
399 | recout = recursecb(dep, a[dep], b[dep]) | ||
400 | if recout: | ||
401 | output.extend(recout) | ||
399 | 402 | ||
400 | a_taint = a_data.get('taint', None) | 403 | a_taint = a_data.get('taint', None) |
401 | b_taint = b_data.get('taint', None) | 404 | b_taint = b_data.get('taint', None) |