diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-02 23:49:09 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-04 23:47:49 +0000 |
commit | 4628fe12e7f2767d243949197c8326e3b7396301 (patch) | |
tree | f65671f46417a7fc5710edec657e22917c2b5f30 /bitbake/lib/bb/data.py | |
parent | b98866d003eb1287909ea74d594cdd12f28466f2 (diff) | |
download | poky-4628fe12e7f2767d243949197c8326e3b7396301.tar.gz |
bitbake: lib/bb: Add expansion parameter to getVarFlag
This sets the scene for removing the default False for expansion from
getVarFlag. This would later allow True to become the expand default.
On the most part this is an automatic translation with:
sed -e 's:\(\.getVarFlag([^,()]*, [^,()]*\)):\1, False):g' -i `grep -ril getVar *`
There should be no functional change from this patch.
(Bitbake rev: 7c3b99c6a716095af3ffce0b15110e91fb49c913)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/data.py')
-rw-r--r-- | bitbake/lib/bb/data.py | 24 |
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 | ||
108 | def getVarFlag(var, flag, d): | 108 | def 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 | ||
112 | def delVarFlag(var, flag, d): | 112 | def 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 | ||
183 | def emit_var(var, o=sys.__stdout__, d = init(), all=False): | 183 | def 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): | |||
245 | def emit_env(o=sys.__stdout__, d = init(), all=False): | 245 | def 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 | ||
255 | def exported_keys(d): | 255 | def 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 | ||
260 | def exported_vars(d): | 260 | def 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): | |||
270 | def emit_func(func, o=sys.__stdout__, d = init()): | 270 | def 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): | |||
416 | def generate_dependencies(d): | 416 | def 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 = {} |