summaryrefslogtreecommitdiff
path: root/mdbp/mmdebstrap.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2022-06-23 19:03:30 +0200
committerHelmut Grohne <helmut@subdivi.de>2022-06-23 19:03:30 +0200
commit465b81f546b465445e55428a15f0d978d9bbb67f (patch)
treec1b912e470f46fa11bfaff971ab36398a7dc4910 /mdbp/mmdebstrap.py
parentf66fdd2bc548dea006899bdde35a8042a70d4f4b (diff)
downloadmdbp-465b81f546b465445e55428a15f0d978d9bbb67f.tar.gz
mmdebstrap: don't show a traceback for build failures
Diffstat (limited to 'mdbp/mmdebstrap.py')
-rw-r--r--mdbp/mmdebstrap.py23
1 files 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)