summaryrefslogtreecommitdiffstats
path: root/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2012-02-27 22:37:32 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-27 20:10:05 +0000
commitae8cf138b5eb8f1f28a7143b8d67ad06cbe43061 (patch)
tree8bc5dc9900b7f29afc0c380c904831331f4273db /lib/bb/data_smart.py
parent4d173d441d2beb8e6492b6b1842682f8cf32e6cc (diff)
downloadbitbake-contrib-ae8cf138b5eb8f1f28a7143b8d67ad06cbe43061.tar.gz
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. 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>
Diffstat (limited to 'lib/bb/data_smart.py')
-rw-r--r--lib/bb/data_smart.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 24c7a8fd6..7765f81b5 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -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()