From 15fa5e5b555fdc1aad10f51822de877cde71294d Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 9 May 2021 07:50:18 +0200 Subject: the stdout fd contains the build log Using a pipe enables streaming of logs, which would not be possible with a regular file output. --- mdbp/sbuild.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mdbp/sbuild.py') 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__": -- cgit v1.2.3