diff options
author | Helmut Grohne <helmut@subdivi.de> | 2021-05-09 07:50:18 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2021-05-09 07:50:18 +0200 |
commit | 15fa5e5b555fdc1aad10f51822de877cde71294d (patch) | |
tree | 6c072ade8fda146e32503fc4afc0414c8263e822 /mdbp/pbuilder.py | |
parent | bf30d5dd03503f776127c42d3f1d8b2ea529b150 (diff) | |
download | mdbp-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/pbuilder.py')
-rw-r--r-- | mdbp/pbuilder.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mdbp/pbuilder.py b/mdbp/pbuilder.py index 8e2556d..a5f734a 100644 --- a/mdbp/pbuilder.py +++ b/mdbp/pbuilder.py @@ -18,6 +18,7 @@ def main() -> None: args = parser.parse_args() build = args.buildjson + enablelog = build["output"].get("log", True) if build.get("lintian", {}).get("run"): raise ValueError("running lintian not supported") if "bd-uninstallable-explainer" in build: @@ -55,9 +56,15 @@ def main() -> None: build.get("type", "binary")]) cmd.extend(profile_option(build, "--profiles")) cmd.extend(["--buildresult", build["output"]["directory"]]) + if not enablelog: + cmd.extend(["--loglevel", "E"]) with get_dsc(build) as dscpath: cmd.append(str(dscpath)) - proc = subprocess.Popen(cmd, env=compute_env(build)) + proc = subprocess.Popen(cmd, env=compute_env(build), + stdout=None if enablelog + else subprocess.DEVNULL, + stderr=subprocess.STDOUT if enablelog + else subprocess.DEVNULL) sys.exit(proc.wait()) if __name__ == "__main__": |