summaryrefslogtreecommitdiff
path: root/mdbp
diff options
context:
space:
mode:
Diffstat (limited to 'mdbp')
-rw-r--r--mdbp/mmdebstrap.py36
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="))