summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data_smart.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r--bitbake/lib/bb/data_smart.py12
1 files changed, 4 insertions, 8 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)