summaryrefslogtreecommitdiff
path: root/bitbake
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-06-16 06:53:24 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-02 15:41:36 +0100
commit56f083ad1354a2b225e602b823cbd2f72335858e (patch)
tree4f919875337548a355de078f3b91e275dfb322c3 /bitbake
parent6be4fa575a36c6c1cd3cb933fafd51dd3bd90c71 (diff)
downloadopenembedded-core-56f083ad1354a2b225e602b823cbd2f72335858e.tar.gz
openembedded-core-56f083ad1354a2b225e602b823cbd2f72335858e.tar.bz2
openembedded-core-56f083ad1354a2b225e602b823cbd2f72335858e.zip
Switch from our own 'dummywrite' class to StringIO
(Bitbake rev: f5b7e16adf86950d91a88a343031e71beb0f08a6) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py17
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 @@
from __future__ import print_function
import sys, os, glob, os.path, re, time
+import sre_constants
+from cStringIO import StringIO
+from contextlib import closing
import bb
from bb import utils, data, parse, event, cache, providers, taskdata, command, runqueue
-import sre_constants
class MultipleMatches(Exception):
"""
@@ -267,20 +269,15 @@ class BBCooker:
bb.msg.error(bb.msg.domain.Parsing, "%s" % e)
raise
- class dummywrite:
- def __init__(self):
- self.writebuf = ""
- def write(self, output):
- self.writebuf = self.writebuf + output
-
# emit variables and shell functions
try:
data.update_data(envdata)
- wb = dummywrite()
- data.emit_env(wb, envdata, True)
- bb.msg.plain(wb.writebuf)
+ with closing(StringIO()) as env:
+ data.emit_env(env, envdata, True)
+ bb.msg.plain(env.getvalue())
except Exception, e:
bb.msg.fatal(bb.msg.domain.Parsing, "%s" % e)
+
# emit the metadata which isnt valid shell
data.expandKeys(envdata)
for e in envdata.keys():