diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-12-14 09:20:33 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 14:46:48 +0000 |
commit | 6f80455777c9d26c3af250904f455cb2bb1fc75a (patch) | |
tree | 5204460473695a98e0c3fa8fa87021729355191b /bitbake/lib/bb/build.py | |
parent | aaa55880ac79f470e613130baefdf317a764cbf2 (diff) | |
download | openembedded-core-6f80455777c9d26c3af250904f455cb2bb1fc75a.tar.gz openembedded-core-6f80455777c9d26c3af250904f455cb2bb1fc75a.tar.bz2 openembedded-core-6f80455777c9d26c3af250904f455cb2bb1fc75a.zip |
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.py | 22 |
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): self._message = "No such task '%s'" % task -class tee(file): +class LogTee(object): + def __init__(self, logger, *files): + self.files = files + self.logger = logger + def write(self, string): - logger.plain(string) - file.write(self, string) + self.logger.plain(string) + for f in self.files: + f.write(string) + + def __enter__(self): + for f in self.files: + f.__enter__() + return self + + def __exit__(self, *excinfo): + for f in self.files: + f.__exit__(*excinfo) def __repr__(self): - return "<open[tee] file '{0}'>".format(self.name) + return '<LogTee {0}>'.format(', '.join(repr(f.name) for f in self.files)) def exec_func(func, d, dirs = None, logfile = NULL): |