Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mike Crowe <mac@mcrowe.com>
To: openembedded-core@lists.openembedded.org
Subject: RFC bitbake patch: siggen.py: report individual changes to dict
Date: Fri, 19 Oct 2012 17:41:36 +0100	[thread overview]
Message-ID: <20121019164136.GA14620@mcrowe.com> (raw)

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:



                 reply	other threads:[~2012-10-19 16:55 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=20121019164136.GA14620@mcrowe.com \
    --to=mac@mcrowe.com \
    --cc=openembedded-core@lists.openembedded.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