diff options
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index ea1347837c..24c7a8fd64 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -31,6 +31,7 @@ BitBake build tools. | |||
31 | import copy, re | 31 | import copy, re |
32 | from collections import MutableMapping | 32 | from collections import MutableMapping |
33 | import logging | 33 | import logging |
34 | import hashlib | ||
34 | import bb, bb.codeparser | 35 | import bb, bb.codeparser |
35 | from bb import utils | 36 | from bb import utils |
36 | from bb.COW import COWDictBase | 37 | from bb.COW import COWDictBase |
@@ -459,3 +460,23 @@ class DataSmart(MutableMapping): | |||
459 | 460 | ||
460 | def __delitem__(self, var): | 461 | def __delitem__(self, var): |
461 | self.delVar(var) | 462 | self.delVar(var) |
463 | |||
464 | def get_hash(self): | ||
465 | data = "" | ||
466 | keys = iter(self) | ||
467 | for key in keys: | ||
468 | if key in ["TIME", "DATE"]: | ||
469 | continue | ||
470 | if key == "__depends": | ||
471 | deps = list(self.getVar(key, False)) | ||
472 | deps.sort() | ||
473 | value = [deps[i][0] for i in range(len(deps))] | ||
474 | elif key == "PATH": | ||
475 | path = list(set(self.getVar(key, False).split(':'))) | ||
476 | path.sort() | ||
477 | value = " ".join(path) | ||
478 | else: | ||
479 | value = self.getVar(key, False) or "" | ||
480 | data = data + key + ': ' + str(value) + '\n' | ||
481 | |||
482 | return hashlib.md5(data).hexdigest() | ||