diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-18 11:35:11 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-19 10:24:50 +0100 |
commit | 798415bd21a73ab7ec3c6ea107b3f3ea81a824aa (patch) | |
tree | 9f735c7b64119d3518688a91834e8710094cdbcc /bitbake/lib | |
parent | 6ab608087af5c09b58737db281ba4181790c033c (diff) | |
download | poky-798415bd21a73ab7ec3c6ea107b3f3ea81a824aa.tar.gz |
bitbake: bitbake: Warn upon finding tab indentation in python functions
Mixed spacing in python functions can cause subtle issues and
generally confuses users. We've standardised on 4 space indentation,
adding this warning helps ensure consistency and avoid bugs. It
also makes _prepend and _append operations on python functions slightly
less risky.
(Bitbake rev: c51cfaf48d3b12a19b01e824b6ba4230376bcad4)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/data.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index e3ffefeb36..5b7a092a21 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py | |||
@@ -291,6 +291,8 @@ def build_dependencies(key, keys, shelldeps, vardepvals, d): | |||
291 | if d.getVarFlag(key, "python"): | 291 | if d.getVarFlag(key, "python"): |
292 | parsedvar = d.expandWithRefs(value, key) | 292 | parsedvar = d.expandWithRefs(value, key) |
293 | parser = bb.codeparser.PythonParser(key, logger) | 293 | parser = bb.codeparser.PythonParser(key, logger) |
294 | if parsedvar.value and "\t" in parsedvar.value: | ||
295 | logger.warn("Variable %s contains tabs, please remove these (%s)" % (key, d.getVar("FILE", True))) | ||
294 | parser.parse_python(parsedvar.value) | 296 | parser.parse_python(parsedvar.value) |
295 | deps = deps | parser.references | 297 | deps = deps | parser.references |
296 | else: | 298 | else: |
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index eae840fa8d..86f94636b9 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py | |||
@@ -212,9 +212,9 @@ class ExportFuncsNode(AstNode): | |||
212 | data.setVarFlag(calledvar, flag, data.getVarFlag(var, flag)) | 212 | data.setVarFlag(calledvar, flag, data.getVarFlag(var, flag)) |
213 | 213 | ||
214 | if data.getVarFlag(calledvar, "python"): | 214 | if data.getVarFlag(calledvar, "python"): |
215 | data.setVar(var, "\tbb.build.exec_func('" + calledvar + "', d)\n") | 215 | data.setVar(var, " bb.build.exec_func('" + calledvar + "', d)\n") |
216 | else: | 216 | else: |
217 | data.setVar(var, "\t" + calledvar + "\n") | 217 | data.setVar(var, " " + calledvar + "\n") |
218 | data.setVarFlag(var, 'export_func', '1') | 218 | data.setVarFlag(var, 'export_func', '1') |
219 | 219 | ||
220 | class AddTaskNode(AstNode): | 220 | class AddTaskNode(AstNode): |