summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2018-11-14 17:46:39 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-19 17:03:25 +0000
commit6b761940fe003b1a0a5934352cd026a22b1a3247 (patch)
tree4b9de5541d7ee61912552994300ab033e4a133fa /bitbake/lib/bb/data_smart.py
parent4a5062302bcdc6292ecbb4deadf1494082c73d97 (diff)
downloadpoky-6b761940fe003b1a0a5934352cd026a22b1a3247.tar.gz
bitbake: 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 (Bitbake rev: 540b546be55e0f5f5d91695956da3a7732b2f90a) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r--bitbake/lib/bb/data_smart.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index efa5a79f78..67af38050e 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -122,7 +122,11 @@ class VariableParse:
122 connector = self.d["_remote_data"] 122 connector = self.d["_remote_data"]
123 return connector.expandPythonRef(self.varname, code, self.d) 123 return connector.expandPythonRef(self.varname, code, self.d)
124 124
125 codeobj = compile(code.strip(), self.varname or "<expansion>", "eval") 125 if self.varname:
126 varname = 'Var <%s>' % self.varname
127 else:
128 varname = '<expansion>'
129 codeobj = compile(code.strip(), varname, "eval")
126 130
127 parser = bb.codeparser.PythonParser(self.varname, logger) 131 parser = bb.codeparser.PythonParser(self.varname, logger)
128 parser.parse_python(code) 132 parser.parse_python(code)