[projects/pld-builder.new] rebuild-kernel-packages: read command output while the command runs
arekm
arekm at pld-linux.org
Sun Nov 8 00:32:23 CET 2026
commit 314ece5c8216fb191b2419c07298a427110f17c4
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Nov 7 23:04:45 2026 +0100
rebuild-kernel-packages: read command output while the command runs
run_command() waited for the command before reading its output, so a
command printing more than the pipe holds hung forever.
client/rebuild-kernel-packages.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/client/rebuild-kernel-packages.py b/client/rebuild-kernel-packages.py
index 10dce47..685404d 100755
--- a/client/rebuild-kernel-packages.py
+++ b/client/rebuild-kernel-packages.py
@@ -54,8 +54,8 @@ def run_command(command, verbose=False, dry_run=False, quiet=True):
if dry_run:
return(True, '')
gitproc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=-1, text=True)
- gitproc.wait()
- out = gitproc.stdout.read().strip("\n'")
+ # read while it runs: waiting first hangs once the output fills the pipe
+ out = gitproc.communicate()[0].strip("\n'")
if not quiet:
print(out)
if gitproc.returncode != 0:
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/0fe372e62d4e92cd30ed562a93b2531e2d750ed1
More information about the pld-cvs-commit
mailing list