diff options
author | Helmut Grohne <helmut@subdivi.de> | 2021-05-19 06:34:29 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2021-05-19 06:34:29 +0200 |
commit | 65431c5ef8824bf233129bbf8e033c8a78d2f591 (patch) | |
tree | dd598400e2006db8de1759a47a93a2fa3f1d9919 /mdbp/pbuilder.py | |
parent | 458255cd158c8fe4545b88c604749b185ecb4e57 (diff) | |
download | mdbp-65431c5ef8824bf233129bbf8e033c8a78d2f591.tar.gz |
pbuilder: support running lintian
Diffstat (limited to 'mdbp/pbuilder.py')
-rw-r--r-- | mdbp/pbuilder.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/mdbp/pbuilder.py b/mdbp/pbuilder.py index d408533..64d218d 100644 --- a/mdbp/pbuilder.py +++ b/mdbp/pbuilder.py @@ -23,8 +23,6 @@ def main() -> None: if "sourcename" in build["input"]: raise ValueError("building a source package by name is not supported") enablelog = build["output"].get("log", True) - if build.get("lintian", {}).get("run"): - raise ValueError("running lintian not supported") if "bd-uninstallable-explainer" in build: raise ValueError("bd-uninstallable-explainer %r not supported" % build["bd-uinstallable-explainer"]) @@ -62,15 +60,24 @@ def main() -> None: cmd.extend(["--buildresult", build["output"]["directory"]]) if not enablelog: cmd.extend(["--loglevel", "E"]) + apt_get = ["apt-get", "-oAPT::Keep-Downloaded-Path=false", "--yes"] with tempfile.TemporaryDirectory() as hookdirn, get_dsc(build) as dscpath: hookdir = pathlib.Path(hookdirn) hook = hookdir / "D50aptupdate" hook.write_text("""#/bin/sh set -e apt-get update -apt-get -oAPT::Keep-Downloaded-Path=false --yes dist-upgrade -""") +%s dist-upgrade +""" % shlex.join(apt_get)) hook.chmod(0o755) + if build["lintian"].get("run", False): + hook = hookdir / "B90lintian" + hook.write_text("""#!/bin/sh +set -e +%s install lintian +runuser -u pbuilder -- lintian %s "${BUILDDIR:-/tmp/buildd}"/*.changes +""" % (shlex.join(apt_get), shlex.join(build["lintian"].get("options", [])))) + hook.chmod(0o755) cmd.extend(["--hookdir", hookdirn, str(dscpath)]) proc = subprocess.Popen(cmd, env=compute_env(build), stdout=None if enablelog |