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 | |
parent | aaa55880ac79f470e613130baefdf317a764cbf2 (diff) | |
download | poky-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')
-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): | |||
103 | self._message = "No such task '%s'" % task | 103 | self._message = "No such task '%s'" % task |
104 | 104 | ||
105 | 105 | ||
106 | class tee(file): | 106 | class 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 | ||
115 | def exec_func(func, d, dirs = None, logfile = NULL): | 129 | def exec_func(func, d, dirs = None, logfile = NULL): |