diff options
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 8f79c4f72c..fd59f05232 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -24,9 +24,11 @@ | |||
24 | 24 | ||
25 | from __future__ import print_function | 25 | from __future__ import print_function |
26 | import sys, os, glob, os.path, re, time | 26 | import sys, os, glob, os.path, re, time |
27 | import sre_constants | ||
28 | from cStringIO import StringIO | ||
29 | from contextlib import closing | ||
27 | import bb | 30 | import bb |
28 | from bb import utils, data, parse, event, cache, providers, taskdata, command, runqueue | 31 | from bb import utils, data, parse, event, cache, providers, taskdata, command, runqueue |
29 | import sre_constants | ||
30 | 32 | ||
31 | class MultipleMatches(Exception): | 33 | class MultipleMatches(Exception): |
32 | """ | 34 | """ |
@@ -267,20 +269,15 @@ class BBCooker: | |||
267 | bb.msg.error(bb.msg.domain.Parsing, "%s" % e) | 269 | bb.msg.error(bb.msg.domain.Parsing, "%s" % e) |
268 | raise | 270 | raise |
269 | 271 | ||
270 | class dummywrite: | ||
271 | def __init__(self): | ||
272 | self.writebuf = "" | ||
273 | def write(self, output): | ||
274 | self.writebuf = self.writebuf + output | ||
275 | |||
276 | # emit variables and shell functions | 272 | # emit variables and shell functions |
277 | try: | 273 | try: |
278 | data.update_data(envdata) | 274 | data.update_data(envdata) |
279 | wb = dummywrite() | 275 | with closing(StringIO()) as env: |
280 | data.emit_env(wb, envdata, True) | 276 | data.emit_env(env, envdata, True) |
281 | bb.msg.plain(wb.writebuf) | 277 | bb.msg.plain(env.getvalue()) |
282 | except Exception, e: | 278 | except Exception, e: |
283 | bb.msg.fatal(bb.msg.domain.Parsing, "%s" % e) | 279 | bb.msg.fatal(bb.msg.domain.Parsing, "%s" % e) |
280 | |||
284 | # emit the metadata which isnt valid shell | 281 | # emit the metadata which isnt valid shell |
285 | data.expandKeys(envdata) | 282 | data.expandKeys(envdata) |
286 | for e in envdata.keys(): | 283 | for e in envdata.keys(): |