summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-10-09 17:40:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-10-10 13:37:56 +0100
commitebaa3e3f5140d99ae1d42a69021edda0b6f379e1 (patch)
treed2c11ba8141a179e650467c265a9583b6253d01d /bitbake
parent20397f8d4b399e27268bb6f29be01739beb95b5f (diff)
downloadpoky-ebaa3e3f5140d99ae1d42a69021edda0b6f379e1.tar.gz
poky-ebaa3e3f5140d99ae1d42a69021edda0b6f379e1.tar.bz2
poky-ebaa3e3f5140d99ae1d42a69021edda0b6f379e1.zip
bitbake: tinfoil: When sending commands we need to process events
The server may be displaying useful information for the user through log messages so we should display anything that has been sent. Its either this or expecting every UI to implement this code around every command call which isn't good API. [YOCTO #14054] (Bitbake rev: 64ae9d7e2fad804dd9e12706c6d76b4b22f9586b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/tinfoil.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py
index 2fb1bb7d27..763c329810 100644
--- a/bitbake/lib/bb/tinfoil.py
+++ b/bitbake/lib/bb/tinfoil.py
@@ -461,7 +461,16 @@ class Tinfoil:
commandline = [command]
if params:
commandline.extend(params)
- result = self.server_connection.connection.runCommand(commandline)
+ try:
+ result = self.server_connection.connection.runCommand(commandline)
+ finally:
+ while True:
+ event = self.wait_event()
+ if not event:
+ break
+ if isinstance(event, logging.LogRecord):
+ if event.taskpid == 0 or event.levelno > logging.INFO:
+ self.logger.handle(event)
if result[1]:
raise TinfoilCommandFailed(result[1])
return result[0]