mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
Consolidate the exec/eval bits, switch anonfunc to better_exec, etc
The methodpool, ${@} expansions, anonymous python functions, event handlers
now all run with the same global context, ensuring a consistent environment
for them. Added a bb.utils.better_eval function which does an eval() with the
same globals as better_exec.
(Bitbake rev: 424d7e267b009cc19b8503eadab782736d9597d0)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
committed by
Richard Purdie
parent
eb16773704
commit
94b60d1247
@@ -203,16 +203,14 @@ def exec_func_python(func, d, runfile, logfile):
|
||||
import re, os
|
||||
|
||||
bbfile = bb.data.getVar('FILE', d, 1)
|
||||
tmp = "def " + func + "():\n%s" % data.getVar(func, d)
|
||||
tmp += '\n' + func + '()'
|
||||
tmp = "def " + func + "(d):\n%s" % data.getVar(func, d)
|
||||
tmp += '\n' + func + '(d)'
|
||||
|
||||
f = open(runfile, "w")
|
||||
f.write(tmp)
|
||||
comp = utils.better_compile(tmp, func, bbfile)
|
||||
g = {} # globals
|
||||
g['d'] = d
|
||||
try:
|
||||
utils.better_exec(comp, g, tmp, bbfile)
|
||||
utils.better_exec(comp, {"d": d}, tmp, bbfile)
|
||||
except:
|
||||
(t,value,tb) = sys.exc_info()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user