[bitbake-devel] data_smart: Improve get_hash to account for overrides and key expansion

Submitted by Richard Purdie on Nov. 29, 2012, 10:29 a.m.


Message ID 1354184946.4943.0.camel@ted
State New
Headers show

Commit Message

Richard Purdie Nov. 29, 2012, 10:29 a.m.
An issue was uncovered where changing:

IMAGE_INSTALL_append = "X"


IMAGE_INSTALL_append = "X Y"

in local.conf would not get noticed by bitbake. The issue is that
the configuration hash doesn't account for overrides or key expansion.

This patch improves get_hash to account for these. This means the hash
does account for changes like the above.

[YOCTO #3503]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index ec3c04e..fb8d9d5 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -474,12 +474,16 @@  class DataSmart(MutableMapping):
     def get_hash(self):
         data = {}
-        config_whitelist = set((self.getVar("BB_HASHCONFIG_WHITELIST", True) or "").split())
-        keys = set(key for key in iter(self) if not key.startswith("__"))
+        d = self.createCopy()
+        bb.data.expandKeys(d)
+        bb.data.update_data(d)
+        config_whitelist = set((d.getVar("BB_HASHCONFIG_WHITELIST", True) or "").split())
+        keys = set(key for key in iter(d) if not key.startswith("__"))
         for key in keys:
             if key in config_whitelist:
-            value = self.getVar(key, False) or ""
+            value = d.getVar(key, False) or ""
         data_str = str([(k, data[k]) for k in sorted(data.keys())])


Trevor Woerner Nov. 29, 2012, 4:20 p.m.
Thank you. This patch solves the problem I was seeing.