From: Kevin Tian <kevin.tian@intel.com>
To: poky@pokylinux.org
Subject: [PATCH 2/3] siggen.py: better print for task hash comparison
Date: Thu, 20 Jan 2011 19:23:59 +0800 [thread overview]
Message-ID: <b7da2f$q6go20@fmsmga001.fm.intel.com> (raw)
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>
---
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 2d28ecf..a101ce8 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"))
--
1.6.0.4
reply other threads:[~2011-01-20 11:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='b7da2f$q6go20@fmsmga001.fm.intel.com' \
--to=kevin.tian@intel.com \
--cc=poky@pokylinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox