diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-12-14 09:25:58 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 14:46:50 +0000 |
commit | 3d51fd2b7d5a0838053db1df3f1e0234ee306411 (patch) | |
tree | 21969fbbf8b7ebdbb06735ff640573498d79e1e9 | |
parent | ea91b1dd878a5c726ee5118b98c4987fa0a994e7 (diff) | |
download | poky-3d51fd2b7d5a0838053db1df3f1e0234ee306411.tar.gz |
build: ensure LogTee has a valid name property
(Bitbake rev: 0ebb46e25261cfc85aaef2790cba7c1ec057c306)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r-- | bitbake/lib/bb/build.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 3138fbc166..f511caeb95 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
@@ -104,26 +104,24 @@ class TaskInvalid(TaskBase): | |||
104 | 104 | ||
105 | 105 | ||
106 | class LogTee(object): | 106 | class LogTee(object): |
107 | def __init__(self, logger, *files): | 107 | def __init__(self, logger, outfile): |
108 | self.files = files | 108 | self.outfile = outfile |
109 | self.logger = logger | 109 | self.logger = logger |
110 | self.name = self.outfile.name | ||
110 | 111 | ||
111 | def write(self, string): | 112 | def write(self, string): |
112 | self.logger.plain(string) | 113 | self.logger.plain(string) |
113 | for f in self.files: | 114 | self.outfile.write(string) |
114 | f.write(string) | ||
115 | 115 | ||
116 | def __enter__(self): | 116 | def __enter__(self): |
117 | for f in self.files: | 117 | self.outfile.__enter__() |
118 | f.__enter__() | ||
119 | return self | 118 | return self |
120 | 119 | ||
121 | def __exit__(self, *excinfo): | 120 | def __exit__(self, *excinfo): |
122 | for f in self.files: | 121 | self.outfile.__exit__(*excinfo) |
123 | f.__exit__(*excinfo) | ||
124 | 122 | ||
125 | def __repr__(self): | 123 | def __repr__(self): |
126 | return '<LogTee {0}>'.format(', '.join(repr(f.name) for f in self.files)) | 124 | return '<LogTee {0}>'.format(self.name) |
127 | 125 | ||
128 | 126 | ||
129 | def exec_func(func, d, dirs = None, logfile = NULL): | 127 | def exec_func(func, d, dirs = None, logfile = NULL): |