diff options
author | Helmut Grohne <helmut@subdivi.de> | 2021-05-16 14:05:40 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2021-05-16 14:05:40 +0200 |
commit | f550b1ba9a507f91fb29f00dc5762ae74afb41a7 (patch) | |
tree | 6fe8375df720e7cb37bba8ebd037c23543cef27c /mdbp | |
parent | b00b6901fe2f1e832ad38a9ca6cfef3c7c2ef831 (diff) | |
download | mdbp-f550b1ba9a507f91fb29f00dc5762ae74afb41a7.tar.gz |
mmdebstrap: reorder source unpack vs build-dep
By doing the unpack before the satisfying build dependencies, we can
point apt at the extracted source package and stop talking about the
.dsc file. It also means that we can clean those artifacts earlier.
Diffstat (limited to 'mdbp')
-rw-r--r-- | mdbp/mmdebstrap.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/mdbp/mmdebstrap.py b/mdbp/mmdebstrap.py index de855f6..d1e13f4 100644 --- a/mdbp/mmdebstrap.py +++ b/mdbp/mmdebstrap.py @@ -83,31 +83,31 @@ def main() -> None: tempfile.NamedTemporaryFile("w+") as script: dscfiles = [dscpath] + get_dsc_files(dscpath) - script.write("#!/bin/sh\nset -u\nset -e\n") - script.write("%s\n" % priv_drop(["chown", "-R", "build:build", - str(buildpath.parent)], - chroot=True)) + script.write("#!/bin/sh\nset -u\nset -e\n%s\n%s\n%s\n" % ( + priv_drop(["chown", "-R", "build:build", "."], + chroot=True, chdir=buildpath.parent), + priv_drop(["dpkg-source", "--no-check", "--extract", dscpath.name, + buildpath.name], + setuid="build", chroot=True, chdir=buildpath.parent), + priv_drop(["rm", *(f.name for f in dscfiles)], + chroot=True, chdir=buildpath.parent))) cmd = ["apt-get", "build-dep", "--yes", - "--host-architecture", hostarch] - cmd.extend(dict(any=["--arch-only"], - all=["--indep-only"]).get(build.get("type"), [])) - cmd.extend(profile_option(build, "--build-profiles")) - cmd.append(str(buildpath.parent / dscpath.name)) + "--host-architecture", hostarch, + *dict(any=["--arch-only"], + all=["--indep-only"]).get(build.get("type"), ()), + *profile_option(build, "--build-profiles"), + "./"] if build.get("bd-uninstallable-explainer") == "apt" and enablelog: - script.write("if ! %s\nthen\n" % priv_drop(cmd, chroot=True)) + script.write("if ! %s\nthen\n" % priv_drop(cmd, chroot=True, + chdir=buildpath)) cmd[-1:-1] = ['-oDebug::pkgProblemResolver=true', '-oDebug::pkgDepCache::Marker=1', '-oDebug::pkgDepCache::AutoInstall=1', '-oDebug::BuildDeps=1'] - script.write("%s\nfi\n" % priv_drop(cmd, chroot=True)) + script.write("%s\nfi\n" % priv_drop(cmd, chroot=True, + chdir=buildpath)) else: - script.write("%s\n" % priv_drop(cmd, chroot=True)) - script.write("%s\n" % priv_drop( - ["dpkg-source", "--no-check", "--extract", dscpath.name, - buildpath.name], - setuid="build", chroot=True, chdir=buildpath.parent)) - script.write("%s\n" % priv_drop(["rm"] + [f.name for f in dscfiles], - chroot=True, chdir=buildpath.parent)) + script.write("%s\n" % priv_drop(cmd, chroot=True, chdir=buildpath)) cmd = ["dpkg-buildpackage", "-uc", "--host-arch=" + hostarch, "--build=" + build.get("type", "binary")] cmd.extend(profile_option(build, "--build-profiles=")) |