[elbe-devel] [PATCH] elbepack: soapclient: properly display messages during wait_busy()

Thomas Weißschuh thomas.weissschuh at linutronix.de
Fri Aug 9 08:48:45 CEST 2024


The messages emitted during wait_busy() are essential for the user
interface. Only logging them is not enough.
Instead yield them for the caller to handle and update the callers to
print them to stdout to preserve the interface.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/commands/control.py  | 3 ++-
 elbepack/commands/pbuilder.py | 9 ++++++---
 elbepack/soapclient.py        | 2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/elbepack/commands/control.py b/elbepack/commands/control.py
index 539b69b6fdcc..5df449b59bd4 100644
--- a/elbepack/commands/control.py
+++ b/elbepack/commands/control.py
@@ -168,7 +168,8 @@ def _get_files(client, args):
 
 @_add_project_dir_argument
 def _wait_busy(client, args):
-    client.wait_busy(args.project_dir)
+    for msg in client.wait_busy(args.project_dir):
+        print(msg)
 
 
 @_add_project_dir_argument
diff --git a/elbepack/commands/pbuilder.py b/elbepack/commands/pbuilder.py
index a2090bca5c3d..9b2de0393002 100644
--- a/elbepack/commands/pbuilder.py
+++ b/elbepack/commands/pbuilder.py
@@ -51,7 +51,8 @@ def _create(control, args):
 
     control.service.build_pbuilder(prjdir, args.cross, args.noccache, args.ccachesize)
 
-    control.wait_busy(prjdir)
+    for msg in control.wait_busy(prjdir):
+        print(msg)
 
     print('')
     print('Building Pbuilder finished !')
@@ -93,7 +94,8 @@ def _build(control, args):
 
         control.service.build_pbuilder(prjdir, args.cross, False, '10G')
 
-        control.wait_busy(prjdir)
+        for msg in control.wait_busy(prjdir):
+            print(msg)
 
         print('')
         print('Building Pbuilder finished !')
@@ -123,7 +125,8 @@ def _build(control, args):
 
     control.set_pdebuild(prjdir, tmp.fname('pdebuild.tar.gz'), args.profile, args.cross)
 
-    control.wait_busy(prjdir)
+    for msg in control.wait_busy(prjdir):
+        print(msg)
 
     print('')
     print('Pdebuild finished !')
diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
index 1974e19013f2..dd1d574fdc07 100644
--- a/elbepack/soapclient.py
+++ b/elbepack/soapclient.py
@@ -165,7 +165,7 @@ class ElbeSoapClient:
             if msg == 'ELBE-FINISH':
                 break
 
-            _logger.info(msg)
+            yield msg
 
         # exited the while loop -> the project is not busy anymore,
         # check, whether everything is ok.

---
base-commit: cac6960a66fa27f9a836b494b20b8d97243a393a
change-id: 20240809-wait_busy-225ea3ed7ef1

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh at linutronix.de>



More information about the elbe-devel mailing list