summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/build.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-12-14 09:20:33 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2011-01-04 14:46:48 +0000
commit6f80455777c9d26c3af250904f455cb2bb1fc75a (patch)
tree5204460473695a98e0c3fa8fa87021729355191b /bitbake/lib/bb/build.py
parentaaa55880ac79f470e613130baefdf317a764cbf2 (diff)
downloadpoky-6f80455777c9d26c3af250904f455cb2bb1fc75a.tar.gz
build: fix -D with shell functions
(Bitbake rev: 1c8be64732fdf4f3a608c090b3dc92065d6058d6) 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.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index e4e767ebc1..3138fbc166 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -103,13 +103,27 @@ class TaskInvalid(TaskBase):
103 self._message = "No such task '%s'" % task 103 self._message = "No such task '%s'" % task
104 104
105 105
106class tee(file): 106class LogTee(object):
107 def __init__(self, logger, *files):
108 self.files = files
109 self.logger = logger
110
107 def write(self, string): 111 def write(self, string):
108 logger.plain(string) 112 self.logger.plain(string)
109 file.write(self, string) 113 for f in self.files:
114 f.write(string)
115
116 def __enter__(self):
117 for f in self.files:
118 f.__enter__()
119 return self
120
121 def __exit__(self, *excinfo):
122 for f in self.files:
123 f.__exit__(*excinfo)
110 124
111 def __repr__(self): 125 def __repr__(self):
112 return "<open[tee] file '{0}'>".format(self.name) 126 return '<LogTee {0}>'.format(', '.join(repr(f.name) for f in self.files))
113 127
114 128
115def exec_func(func, d, dirs = None, logfile = NULL): 129def exec_func(func, d, dirs = None, logfile = NULL):