summaryrefslogtreecommitdiff
path: root/mdbp/sbuild.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2021-05-09 07:50:18 +0200
committerHelmut Grohne <helmut@subdivi.de>2021-05-09 07:50:18 +0200
commit15fa5e5b555fdc1aad10f51822de877cde71294d (patch)
tree6c072ade8fda146e32503fc4afc0414c8263e822 /mdbp/sbuild.py
parentbf30d5dd03503f776127c42d3f1d8b2ea529b150 (diff)
downloadmdbp-15fa5e5b555fdc1aad10f51822de877cde71294d.tar.gz
the stdout fd contains the build log
Using a pipe enables streaming of logs, which would not be possible with a regular file output.
Diffstat (limited to 'mdbp/sbuild.py')
-rw-r--r--mdbp/sbuild.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/mdbp/sbuild.py b/mdbp/sbuild.py
index 6b9c33d..ffaeaf2 100644
--- a/mdbp/sbuild.py
+++ b/mdbp/sbuild.py
@@ -47,7 +47,12 @@ def main() -> None:
with get_dsc(build) as dscpath:
cmd.append(str(dscpath.absolute()))
proc = subprocess.Popen(cmd, env=compute_env(build),
- cwd=build["output"]["directory"])
+ cwd=build["output"]["directory"],
+ stdout=None if build["output"].get("log", True)
+ else subprocess.DEVNULL,
+ stderr=subprocess.STDOUT
+ if build["output"].get("log", True)
+ else subprocess.DEVNULL)
sys.exit(proc.wait())
if __name__ == "__main__":