From 465b81f546b465445e55428a15f0d978d9bbb67f Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 23 Jun 2022 19:03:30 +0200 Subject: mmdebstrap: don't show a traceback for build failures --- mdbp/mmdebstrap.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/mdbp/mmdebstrap.py b/mdbp/mmdebstrap.py index 6555d3f..65a4856 100644 --- a/mdbp/mmdebstrap.py +++ b/mdbp/mmdebstrap.py @@ -123,12 +123,23 @@ def hook_main(buildjsonfilename: str, chrootname: str) -> None: '-oDebug::pkgDepCache::AutoInstall=1', '-oDebug::BuildDeps=1'] priv_drop(cmd, chroot=chroot, chdir=builddir / subdir) - priv_drop(["dpkg-buildpackage", "-uc", "--host-arch=" + hostarch, - "--build=" + build.get("type", "binary"), - *profile_option(build, "--build-profiles=")], - chroot=chroot, setuid="build", - privnet=not build.get("network") in ("enable", "try-enable"), - chdir=builddir / subdir, env=compute_env(build)) + try: + priv_drop( + [ + "dpkg-buildpackage", + "-uc", + "--host-arch=" + hostarch, + "--build=" + build.get("type", "binary"), + *profile_option(build, "--build-profiles="), + ], + chroot=chroot, + setuid="build", + privnet=not build.get("network") in ("enable", "try-enable"), + chdir=builddir / subdir, + env=compute_env(build), + ) + except subprocess.CalledProcessError as cpe: + sys.exit(cpe.returncode) shutil.rmtree(fullbuilddir / subdir) if build.get("lintian", {}).get("run"): priv_drop([*apt_get, "install", "lintian"], chroot=chroot) -- cgit v1.2.3