From patchwork Fri Oct 19 16:41:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: RFC bitbake patch: siggen.py: report individual changes to dict Date: Fri, 19 Oct 2012 16:41:36 -0000 From: Mike Crowe X-Patchwork-Id: 38339 Message-Id: <20121019164136.GA14620@mcrowe.com> To: openembedded-core@lists.openembedded.org I found it quite difficult to find the actual change among the copious output of bitbake-diffsigs when the environment differs so I came up with this to simplify the reporting. -----8<---- siggen.py: If changed variable is a dict then report the individual values that have changed If the signature has changed due to a variable changing and that variable is a dict then try and report the individual values that have changed. diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py index 862c73b..c72b164 100644 --- a/lib/bb/siggen.py +++ b/lib/bb/siggen.py @@ -363,7 +363,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])) + if isinstance(a_data['varvals'][dep], dict) and isinstance(b_data['varvals'][dep], dict): + subchanged, subadded, subremoved = dict_diff(a_data['varvals'][dep], b_data['varvals'][dep]) + for k in subchanged: + output.append("Variable %s value ['%s'] changed from '%s' to '%s'. " % (dep, k, a_data['varvals'][dep][k], b_data['varvals'][dep][k])) + for k in subadded: + output.append("Variable %s value ['%s'] changed from not present to '%s'. " % (dep, k, b_data['varvals'][dep][k])) + for k in subremoved: + output.append("Variable %s value ['%s'] changed from '%s' to not present. " % (dep, k, a_data['varvals'][dep][k])) + else: + output.append("Variable %s value changed from %s to %s" % (dep, a_data['varvals'][dep], b_data['varvals'][dep])) changed, added, removed = dict_diff(a_data['file_checksum_values'], b_data['file_checksum_values']) if changed: