diff options
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 12 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 4 |
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 |