summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/data.py')
-rw-r--r--bitbake/lib/bb/data.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index 70ba56b48a..44f817e6c8 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -107,7 +107,7 @@ def setVarFlag(var, flag, flagvalue, d):
107 107
108def getVarFlag(var, flag, d): 108def getVarFlag(var, flag, d):
109 """Gets given flag from given var""" 109 """Gets given flag from given var"""
110 return d.getVarFlag(var, flag) 110 return d.getVarFlag(var, flag, False)
111 111
112def delVarFlag(var, flag, d): 112def delVarFlag(var, flag, d):
113 """Removes a given flag from the variable's flags""" 113 """Removes a given flag from the variable's flags"""
@@ -182,12 +182,12 @@ def inheritFromOS(d, savedenv, permitted):
182 182
183def emit_var(var, o=sys.__stdout__, d = init(), all=False): 183def emit_var(var, o=sys.__stdout__, d = init(), all=False):
184 """Emit a variable to be sourced by a shell.""" 184 """Emit a variable to be sourced by a shell."""
185 if d.getVarFlag(var, "python"): 185 if d.getVarFlag(var, "python", False):
186 return False 186 return False
187 187
188 export = d.getVarFlag(var, "export") 188 export = d.getVarFlag(var, "export", False)
189 unexport = d.getVarFlag(var, "unexport") 189 unexport = d.getVarFlag(var, "unexport", False)
190 func = d.getVarFlag(var, "func") 190 func = d.getVarFlag(var, "func", False)
191 if not all and not export and not unexport and not func: 191 if not all and not export and not unexport and not func:
192 return False 192 return False
193 193
@@ -245,7 +245,7 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False):
245def emit_env(o=sys.__stdout__, d = init(), all=False): 245def emit_env(o=sys.__stdout__, d = init(), all=False):
246 """Emits all items in the data store in a format such that it can be sourced by a shell.""" 246 """Emits all items in the data store in a format such that it can be sourced by a shell."""
247 247
248 isfunc = lambda key: bool(d.getVarFlag(key, "func")) 248 isfunc = lambda key: bool(d.getVarFlag(key, "func", False))
249 keys = sorted((key for key in d.keys() if not key.startswith("__")), key=isfunc) 249 keys = sorted((key for key in d.keys() if not key.startswith("__")), key=isfunc)
250 grouped = groupby(keys, isfunc) 250 grouped = groupby(keys, isfunc)
251 for isfunc, keys in grouped: 251 for isfunc, keys in grouped:
@@ -254,8 +254,8 @@ def emit_env(o=sys.__stdout__, d = init(), all=False):
254 254
255def exported_keys(d): 255def exported_keys(d):
256 return (key for key in d.keys() if not key.startswith('__') and 256 return (key for key in d.keys() if not key.startswith('__') and
257 d.getVarFlag(key, 'export') and 257 d.getVarFlag(key, 'export', False) and
258 not d.getVarFlag(key, 'unexport')) 258 not d.getVarFlag(key, 'unexport', False))
259 259
260def exported_vars(d): 260def exported_vars(d):
261 for key in exported_keys(d): 261 for key in exported_keys(d):
@@ -270,7 +270,7 @@ def exported_vars(d):
270def emit_func(func, o=sys.__stdout__, d = init()): 270def emit_func(func, o=sys.__stdout__, d = init()):
271 """Emits all items in the data store in a format such that it can be sourced by a shell.""" 271 """Emits all items in the data store in a format such that it can be sourced by a shell."""
272 272
273 keys = (key for key in d.keys() if not key.startswith("__") and not d.getVarFlag(key, "func")) 273 keys = (key for key in d.keys() if not key.startswith("__") and not d.getVarFlag(key, "func", False))
274 for key in keys: 274 for key in keys:
275 emit_var(key, o, d, False) 275 emit_var(key, o, d, False)
276 276
@@ -284,7 +284,7 @@ def emit_func(func, o=sys.__stdout__, d = init()):
284 seen |= deps 284 seen |= deps
285 newdeps = set() 285 newdeps = set()
286 for dep in deps: 286 for dep in deps:
287 if d.getVarFlag(dep, "func") and not d.getVarFlag(dep, "python"): 287 if d.getVarFlag(dep, "func", False) and not d.getVarFlag(dep, "python", False):
288 emit_var(dep, o, d, False) and o.write('\n') 288 emit_var(dep, o, d, False) and o.write('\n')
289 newdeps |= bb.codeparser.ShellParser(dep, logger).parse_shell(d.getVar(dep, True)) 289 newdeps |= bb.codeparser.ShellParser(dep, logger).parse_shell(d.getVar(dep, True))
290 newdeps |= set((d.getVarFlag(dep, "vardeps", True) or "").split()) 290 newdeps |= set((d.getVarFlag(dep, "vardeps", True) or "").split())
@@ -317,7 +317,7 @@ def emit_func_python(func, o=sys.__stdout__, d = init()):
317 seen |= deps 317 seen |= deps
318 newdeps = set() 318 newdeps = set()
319 for dep in deps: 319 for dep in deps:
320 if d.getVarFlag(dep, "func") and d.getVarFlag(dep, "python"): 320 if d.getVarFlag(dep, "func", False) and d.getVarFlag(dep, "python", False):
321 write_func(dep, o) 321 write_func(dep, o)
322 pp = bb.codeparser.PythonParser(dep, logger) 322 pp = bb.codeparser.PythonParser(dep, logger)
323 pp.parse_python(d.getVar(dep, True)) 323 pp.parse_python(d.getVar(dep, True))
@@ -416,7 +416,7 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
416def generate_dependencies(d): 416def generate_dependencies(d):
417 417
418 keys = set(key for key in d if not key.startswith("__")) 418 keys = set(key for key in d if not key.startswith("__"))
419 shelldeps = set(key for key in d.getVar("__exportlist", False) if d.getVarFlag(key, "export") and not d.getVarFlag(key, "unexport")) 419 shelldeps = set(key for key in d.getVar("__exportlist", False) if d.getVarFlag(key, "export", False) and not d.getVarFlag(key, "unexport", False))
420 varflagsexcl = d.getVar('BB_SIGNATURE_EXCLUDE_FLAGS', True) 420 varflagsexcl = d.getVar('BB_SIGNATURE_EXCLUDE_FLAGS', True)
421 421
422 deps = {} 422 deps = {}