From 4d254ae63a35231c98e3f73f669b040ed1144042 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Fri, 7 Apr 2017 09:52:05 +1200 Subject: lib/bb/siggen: show a diff when dumping changes to multi-line values When dumping changes to signatures e.g. output of bitbake -s printdiff, if for example a function has changed, it's much more readable to see a unified diff of the changes rather than just printing the old function followed by the new function, so use difflib to do that. Note: I elected to keep to one item in the returned list per change, rather than one line per line of output, so that the caller can still look at changes individually if needed. Thus I've added some handling to bitbake-diffsigs to split the change into lines so that each line is displayed indented. Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- bin/bitbake-diffsigs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/bitbake-diffsigs b/bin/bitbake-diffsigs index 5400e5b92..4ca085f07 100755 --- a/bin/bitbake-diffsigs +++ b/bin/bitbake-diffsigs @@ -67,7 +67,9 @@ def find_compare_task(bbhandler, pn, taskname): recout.append("Unable to find matching sigdata for %s with hash %s" % (key, hash2)) else: out2 = bb.siggen.compare_sigfiles(hashfiles[hash1], hashfiles[hash2], recursecb) - recout.extend(list(' ' + l for l in out2)) + for change in out2: + for line in change.splitlines(): + recout.append(' ' + line) return recout -- cgit 1.2.3-korg