[oe-commits] [bitbake] 05/07: data_smart: fix filename for compile()
git at git.openembedded.org
git at git.openembedded.org
Fri Nov 16 14:03:10 UTC 2018
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository bitbake.
commit 540b546be55e0f5f5d91695956da3a7732b2f90a
Author: Robert Yang <liezhi.yang at windriver.com>
AuthorDate: Wed Nov 14 17:46:39 2018 +0800
data_smart: fix filename for compile()
Fixed:
Add the following two lines to conf/local.conf:
FOO = "${@foo = 5}"
HOSTTOOLS += "${FOO}"
* Before the patch
$ bitbake -p
Check the first lines of bitbake bitbake-cookerdaemon.log
[snip]
File "/buildarea1/lyang1/poky/bitbake/lib/bb/data_smart.py", line 125, in python_sub
codeobj = compile(code.strip(), self.varname or "<expansion>", "eval")
File "FOO", line 1
[snip]
There isn't a file named 'FOO', but a variable name.
* After the patch
$ bitbake -p
[snip]
File "/buildarea1/lyang1/poky/bitbake/lib/bb/data_smart.py", line 129, in python_sub
codeobj = compile(code.strip(), varname, "eval")
File "Var <FOO>", line 1
foo = 5
Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/data_smart.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index efa5a79..67af380 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -122,7 +122,11 @@ class VariableParse:
connector = self.d["_remote_data"]
return connector.expandPythonRef(self.varname, code, self.d)
- codeobj = compile(code.strip(), self.varname or "<expansion>", "eval")
+ if self.varname:
+ varname = 'Var <%s>' % self.varname
+ else:
+ varname = '<expansion>'
+ codeobj = compile(code.strip(), varname, "eval")
parser = bb.codeparser.PythonParser(self.varname, logger)
parser.parse_python(code)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list