summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-25 22:59:39 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-26 23:01:33 +0000
commita10301f6a90567c2d2eca9306a4b7b752f58a9c2 (patch)
tree41da459bd5e16ee0d8e9d502532b34c284e0fdd9 /bitbake/lib/bb/data_smart.py
parentd0616923724c5d021a816ec778e836283a2ccfe2 (diff)
downloadpoky-a10301f6a90567c2d2eca9306a4b7b752f58a9c2.tar.gz
bitbake: data/codeparser: Improve handling of contains functions
One of the current frustrations with the sstate checksums is that code like base_contains('X', 'y',...) adds a full dependency on X and varies depend even on whitespace changes in X. This patch adds special handling of the contains functions to expand the first parameter and check for the flag specified by the second parameter (assuming its a string). The result is then appended to the value of the variable with a "Set" or "Unset" status. If the flag is added/removed, the stored variable value changes and hence the checksum changes. No dependency on X is added so it is free to change with regard to other flags or whitespace. This code is far from ideal, ideally we'd have properly typed variables however it fixes a major annoyance of the current checksums and is of enough value its worth adding in a stopgap solution. It shouldn't significantly restrict any propely typed variable implementation in future. (Bitbake rev: ed2d0a22a80299de0cfd377999950cf4b26c512e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r--bitbake/lib/bb/data_smart.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index a1cbaba62b..9a6f767116 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -35,6 +35,7 @@ import hashlib
35import bb, bb.codeparser 35import bb, bb.codeparser
36from bb import utils 36from bb import utils
37from bb.COW import COWDictBase 37from bb.COW import COWDictBase
38import collections
38 39
39logger = logging.getLogger("BitBake.Data") 40logger = logging.getLogger("BitBake.Data")
40 41
@@ -88,6 +89,7 @@ class VariableParse:
88 89
89 self.references = set() 90 self.references = set()
90 self.execs = set() 91 self.execs = set()
92 self.contains = collections.defaultdict(set)
91 93
92 def var_sub(self, match): 94 def var_sub(self, match):
93 key = match.group()[2:-1] 95 key = match.group()[2:-1]
@@ -120,6 +122,8 @@ class VariableParse:
120 self.references |= parser.references 122 self.references |= parser.references
121 self.execs |= parser.execs 123 self.execs |= parser.execs
122 124
125 for k in parser.contains:
126 self.contains[k].update(parser.contains[k])
123 value = utils.better_eval(codeobj, DataContext(self.d)) 127 value = utils.better_eval(codeobj, DataContext(self.d))
124 return str(value) 128 return str(value)
125 129