summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-05 11:02:04 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-05 11:39:05 +0100
commit56e46f0bc41013f6857fdb85c82c0ebf75d822f9 (patch)
tree76e9b0856abf5941d7d47217d10b4fd0a1783337
parentc6dac094ac79f6eae6998527e025417e16b46eed (diff)
downloadpoky-56e46f0bc41013f6857fdb85c82c0ebf75d822f9.tar.gz
bitbake/ast: Fix ??= vs. ?= handling
As the code stands, setting a variable with ??= could result in a ?= variable not overriding it. This patch fixes the issue by allowing the ast to make lookups that ignore any ??= set variables. (Bitbake rev: 32fee2e650dfdd3aa9a7572dad1251e0c24ca34b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/data_smart.py12
-rw-r--r--bitbake/lib/bb/parse/ast.py4
2 files changed, 6 insertions, 10 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 8f67227bd6..301f9e3729 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -267,12 +267,8 @@ class DataSmart(MutableMapping):
267 # setting var 267 # setting var
268 self.dict[var]["content"] = value 268 self.dict[var]["content"] = value
269 269
270 def getVar(self, var, exp): 270 def getVar(self, var, expand=False, noweakdefault=False):
271 value = self.getVarFlag(var, "content") 271 return self.getVarFlag(var, "content", expand, noweakdefault)
272
273 if exp and value:
274 return self.expand(value, var)
275 return value
276 272
277 def renameVar(self, key, newkey): 273 def renameVar(self, key, newkey):
278 """ 274 """
@@ -310,13 +306,13 @@ class DataSmart(MutableMapping):
310 self._makeShadowCopy(var) 306 self._makeShadowCopy(var)
311 self.dict[var][flag] = flagvalue 307 self.dict[var][flag] = flagvalue
312 308
313 def getVarFlag(self, var, flag, expand=False): 309 def getVarFlag(self, var, flag, expand=False, noweakdefault=False):
314 local_var = self._findVar(var) 310 local_var = self._findVar(var)
315 value = None 311 value = None
316 if local_var: 312 if local_var:
317 if flag in local_var: 313 if flag in local_var:
318 value = copy.copy(local_var[flag]) 314 value = copy.copy(local_var[flag])
319 elif flag == "content" and "defaultval" in local_var: 315 elif flag == "content" and "defaultval" in local_var and not noweakdefault:
320 value = copy.copy(local_var["defaultval"]) 316 value = copy.copy(local_var["defaultval"])
321 if expand and value: 317 if expand and value:
322 value = self.expand(value, None) 318 value = self.expand(value, None)
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index e41bb74f40..2301abd12b 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -84,9 +84,9 @@ class DataNode(AstNode):
84 84
85 def getFunc(self, key, data): 85 def getFunc(self, key, data):
86 if 'flag' in self.groupd and self.groupd['flag'] != None: 86 if 'flag' in self.groupd and self.groupd['flag'] != None:
87 return bb.data.getVarFlag(key, self.groupd['flag'], data) 87 return data.getVarFlag(key, self.groupd['flag'], noweakdefault=True)
88 else: 88 else:
89 return bb.data.getVar(key, data) 89 return data.getVar(key, noweakdefault=True)
90 90
91 def eval(self, data): 91 def eval(self, data):
92 groupd = self.groupd 92 groupd = self.groupd