From: Daan De Meyer Date: Sun, 22 Dec 2024 20:03:40 +0000 (+0100) Subject: Move adding "--" to spawn() X-Git-Tag: v25~96^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dab6522cf4be040955c65eab9a192ca0d2e35e95;p=thirdparty%2Fmkosi.git Move adding "--" to spawn() --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index be5e7e851..89079b7a9 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -642,7 +642,6 @@ def script_maybe_chroot_sandbox( "--chdir", "/work/src", *(["--ro-bind-try", "/etc/resolv.conf", "/etc/resolv.conf"] if network else []), *(["--suppress-chown"] if suppress_chown else []), - "--", ], "mkosi-as-caller": mkosi_as_caller(), **context.config.distribution.package_manager(context.config).scripts(context), diff --git a/mkosi/installer/__init__.py b/mkosi/installer/__init__.py index ebf858b47..5f78a07ee 100644 --- a/mkosi/installer/__init__.py +++ b/mkosi/installer/__init__.py @@ -123,7 +123,6 @@ class PackageManager: "--bind", "/var/tmp", "/buildroot/var/tmp", *apivfs_options(), *cls.options(root="/buildroot"), - "--", ] # fmt: skip @classmethod diff --git a/mkosi/run.py b/mkosi/run.py index 626256474..fb483319d 100644 --- a/mkosi/run.py +++ b/mkosi/run.py @@ -261,6 +261,9 @@ def spawn( with sandbox as sbx: prefix = [os.fspath(x) for x in sbx] + if prefix: + prefix += ["--"] + try: with subprocess.Popen( [*prefix, *cmdline], @@ -605,7 +608,7 @@ def sandbox_cmd( if not overlay and not relaxed: tmp = stack.enter_context(vartmpdir()) - yield [*cmdline, "--bind", tmp, "/var/tmp", "--dir", "/tmp", "--dir", "/run", *options, "--"] + yield [*cmdline, "--bind", tmp, "/var/tmp", "--dir", "/tmp", "--dir", "/run", *options] return for d in ("etc", "opt"): @@ -645,7 +648,7 @@ def sandbox_cmd( tmp = stack.enter_context(vartmpdir()) cmdline += ["--bind", tmp, "/var/tmp"] - yield [*cmdline, *options, "--"] + yield [*cmdline, *options] def apivfs_options(*, root: Path = Path("/buildroot")) -> list[PathString]: @@ -700,7 +703,7 @@ def chroot_cmd( cmdline += ["--ro-bind", "/etc/resolv.conf", "/etc/resolv.conf"] with vartmpdir() as dir: - yield [*cmdline, "--bind", dir, "/var/tmp", *options, "--"] + yield [*cmdline, "--bind", dir, "/var/tmp", *options] def finalize_interpreter(tools: bool) -> str: