Browse Source

data_smart: Handle hashing of datastores within datastores correctly

If there is a datastore within a datastore (e.g. BB_ORIGENV) then
get-hash() doesn;t correclty handle the contents using the memory
address instead of the contents.

This is a patch from dominik.jaeger@nokia.com which addresses
this problem. Its been low priority since we don't include
BB_ORIGENV anywhere this would cause an issue as standard.

[YOCTO #12473]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Richard Purdie 4 years ago
parent
commit
1a8bcfc1eb
1 changed files with 4 additions and 1 deletions
  1. 4 1
      lib/bb/data_smart.py

+ 4 - 1
lib/bb/data_smart.py

@@ -1000,7 +1000,10 @@ class DataSmart(MutableMapping):
                 continue
 
             value = d.getVar(key, False) or ""
-            data.update({key:value})
+            if type(value) is type(self):
+                data.update({key:value.get_hash()})
+            else:
+                data.update({key:value})
 
             varflags = d.getVarFlags(key, internalflags = True)
             if not varflags: