data_smart.py: Uses BB_HASHCONFIG_WHITELIST to filter unnecessary variables
Adopt the BB_HASHCONFIG_WHITELIST as a exclusion list for variables that are not needed in cache hash calculation. (Bitbake rev: ae8cf138b5eb8f1f28a7143b8d67ad06cbe43061) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> CC: Christopher Larson <kergoth@gmail.com> CC: Martin Jansa <martin.jansa@gmail.com> CC: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
f420fb3de1
commit
a295cdc19f
|
@ -463,20 +463,12 @@ class DataSmart(MutableMapping):
|
|||
|
||||
def get_hash(self):
|
||||
data = ""
|
||||
keys = iter(self)
|
||||
config_whitelist = set((self.getVar("BB_HASHCONFIG_WHITELIST", True) or "").split())
|
||||
keys = set(key for key in iter(self) if not key.startswith("__"))
|
||||
for key in keys:
|
||||
if key in ["TIME", "DATE"]:
|
||||
if key in config_whitelist:
|
||||
continue
|
||||
if key == "__depends":
|
||||
deps = list(self.getVar(key, False))
|
||||
deps.sort()
|
||||
value = [deps[i][0] for i in range(len(deps))]
|
||||
elif key == "PATH":
|
||||
path = list(set(self.getVar(key, False).split(':')))
|
||||
path.sort()
|
||||
value = " ".join(path)
|
||||
else:
|
||||
value = self.getVar(key, False) or ""
|
||||
value = self.getVar(key, False) or ""
|
||||
data = data + key + ': ' + str(value) + '\n'
|
||||
|
||||
return hashlib.md5(data).hexdigest()
|
||||
|
|
Loading…
Reference in New Issue