diff options
author | Kevin Tian <kevin.tian@intel.com> | 2011-01-20 13:54:51 +0800 |
---|---|---|
committer | Saul Wold <sgw@linux.intel.com> | 2011-01-21 01:36:17 -0800 |
commit | bcb18738361ee2394bc266911e9e75d5bf1c10cd (patch) | |
tree | aed75d520afb8f868ed89f738e47ab4d88020228 /bitbake | |
parent | 6299e9664f2e9fa62630955ed21a2fee98e2915c (diff) | |
download | openembedded-core-bcb18738361ee2394bc266911e9e75d5bf1c10cd.tar.gz openembedded-core-bcb18738361ee2394bc266911e9e75d5bf1c10cd.tar.bz2 openembedded-core-bcb18738361ee2394bc266911e9e75d5bf1c10cd.zip |
siggen.py: better print for task hash comparison
current bitbake-diffsigs simply print out the whole 'runtaskdeps' when there's mismatch, which
is not very readable. On the other hand, 'runtaskhashes' comparison is broken which assumes
same key existing in two sides. This commit provides better output by figuring out differences
from addition, removal or hash change.
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/siggen.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index 2d28ecfc2d..a101ce8bb3 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py @@ -255,13 +255,20 @@ def compare_sigfiles(a, b): if changed: for dep in changed: print "Variable %s value changed from %s to %s" % (dep, a_data['varvals'][dep], b_data['varvals'][dep]) - if 'runtaskdeps' in a_data and 'runtaskdeps' in b_data and sorted(a_data['runtaskdeps']) != sorted(b_data['runtaskdeps']): - print "Tasks this task depends on changed from %s to %s" % (sorted(a_data['runtaskdeps']), sorted(b_data['runtaskdeps'])) - if 'runtaskhashes' in a_data: - for dep in a_data['runtaskhashes']: - if a_data['runtaskhashes'][dep] != b_data['runtaskhashes'][dep]: + if 'runtaskhashes' in a_data and 'runtaskhashes' in b_data: + changed, added, removed = dict_diff(a_data['runtaskhashes'], b_data['runtaskhashes']) + if added: + for dep in added: + print "Dependency on task %s was added" % (dep) + if removed: + for dep in removed: + print "Dependency on task %s was removed" % (dep) + if changed: + for dep in changed: print "Hash for dependent task %s changed from %s to %s" % (dep, a_data['runtaskhashes'][dep], b_data['runtaskhashes'][dep]) + elif 'runtaskdeps' in a_data and 'runtaskdeps' in b_data and sorted(a_data['runtaskdeps']) != sorted(b_data['runtaskdeps']): + print "Tasks this task depends on changed from %s to %s" % (sorted(a_data['runtaskdeps']), sorted(b_data['runtaskdeps'])) def dump_sigfile(a): p1 = pickle.Unpickler(file(a, "rb")) |