From e58eb8cbb0f9ecd4afa23ffb64c8467b24d93c5c Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Mon, 27 Aug 2012 21:44:35 +0100 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/bb/siggen.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'bitbake/lib/bb/siggen.py') 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): b[clean_basepath(x)] = a[x] return b -def compare_sigfiles(a, b): +def compare_sigfiles(a, b, recursecb = None): output = [] p1 = pickle.Unpickler(open(a, "rb")) @@ -369,8 +369,8 @@ def compare_sigfiles(a, b): if 'runtaskhashes' in a_data and 'runtaskhashes' in b_data: - a = clean_basepaths(a_data['runtaskhashes']) - b = clean_basepaths(b_data['runtaskhashes']) + a = a_data['runtaskhashes'] + b = b_data['runtaskhashes'] changed, added, removed = dict_diff(a, b) if added: for dep in added: @@ -381,7 +381,7 @@ def compare_sigfiles(a, b): #output.append("Dependency on task %s was replaced by %s with same hash" % (dep, bdep)) bdep_found = True if not bdep_found: - output.append("Dependency on task %s was added with hash %s" % (dep, a[dep])) + output.append("Dependency on task %s was added with hash %s" % (clean_basepath(dep), a[dep])) if removed: for dep in removed: adep_found = False @@ -391,11 +391,14 @@ def compare_sigfiles(a, b): #output.append("Dependency on task %s was replaced by %s with same hash" % (adep, dep)) adep_found = True if not adep_found: - output.append("Dependency on task %s was removed with hash %s" % (dep, b[dep])) + output.append("Dependency on task %s was removed with hash %s" % (clean_basepath(dep), b[dep])) if changed: for dep in changed: - output.append("Hash for dependent task %s changed from %s to %s" % (dep, a[dep], b[dep])) - + output.append("Hash for dependent task %s changed from %s to %s" % (clean_basepath(dep), a[dep], b[dep])) + if callable(recursecb): + recout = recursecb(dep, a[dep], b[dep]) + if recout: + output.extend(recout) a_taint = a_data.get('taint', None) b_taint = b_data.get('taint', None) -- cgit v1.2.3-54-g00ecf