summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/build.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-03-30 20:06:07 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-02 15:41:31 +0100
commit94b60d1247be4ce42eaefafe13e73169bd978bd7 (patch)
tree3a8ed098cc96b5ee63c6652c8d49cda6c99a5524 /bitbake/lib/bb/build.py
parenteb167737041d8754988d153e0495268f03b6e809 (diff)
downloadpoky-94b60d1247be4ce42eaefafe13e73169bd978bd7.tar.gz
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>
Diffstat (limited to 'bitbake/lib/bb/build.py')
-rw-r--r--bitbake/lib/bb/build.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 43dbfc1363..16d69281f1 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -203,16 +203,14 @@ def exec_func_python(func, d, runfile, logfile):
203 import re, os 203 import re, os
204 204
205 bbfile = bb.data.getVar('FILE', d, 1) 205 bbfile = bb.data.getVar('FILE', d, 1)
206 tmp = "def " + func + "():\n%s" % data.getVar(func, d) 206 tmp = "def " + func + "(d):\n%s" % data.getVar(func, d)
207 tmp += '\n' + func + '()' 207 tmp += '\n' + func + '(d)'
208 208
209 f = open(runfile, "w") 209 f = open(runfile, "w")
210 f.write(tmp) 210 f.write(tmp)
211 comp = utils.better_compile(tmp, func, bbfile) 211 comp = utils.better_compile(tmp, func, bbfile)
212 g = {} # globals
213 g['d'] = d
214 try: 212 try:
215 utils.better_exec(comp, g, tmp, bbfile) 213 utils.better_exec(comp, {"d": d}, tmp, bbfile)
216 except: 214 except:
217 (t,value,tb) = sys.exc_info() 215 (t,value,tb) = sys.exc_info()
218 216