diff --git a/bitbake/bin/bitbake-diffsigs b/bitbake/bin/bitbake-diffsigs index 5400e5b92b..4ca085f073 100755 --- a/bitbake/bin/bitbake-diffsigs +++ b/bitbake/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 diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index f47af6ded8..f497fb9caf 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py @@ -5,6 +5,7 @@ import re import tempfile import pickle import bb.data +import difflib from bb.checksum import FileChecksumCache logger = logging.getLogger('BitBake.SigGen') @@ -462,7 +463,16 @@ def compare_sigfiles(a, b, recursecb = None): changed, added, removed = dict_diff(a_data['varvals'], b_data['varvals']) if changed: for dep in changed: - output.append("Variable %s value changed from '%s' to '%s'" % (dep, a_data['varvals'][dep], b_data['varvals'][dep])) + oldval = a_data['varvals'][dep] + newval = b_data['varvals'][dep] + if newval and oldval and ('\n' in oldval or '\n' in newval): + diff = difflib.unified_diff(oldval.splitlines(), newval.splitlines(), lineterm='') + # Cut off the first two lines, since we aren't interested in + # the old/new filename (they are blank anyway in this case) + difflines = list(diff)[2:] + output.append("Variable %s value changed:\n%s" % (dep, '\n'.join(difflines))) + else: + output.append("Variable %s value changed from '%s' to '%s'" % (dep, oldval, newval)) if not 'file_checksum_values' in a_data: a_data['file_checksum_values'] = {}