]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Move adding "--" to spawn()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 22 Dec 2024 20:03:40 +0000 (21:03 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 22 Dec 2024 20:22:43 +0000 (21:22 +0100)
mkosi/__init__.py
mkosi/installer/__init__.py
mkosi/run.py

index be5e7e85110d3bf9a5e194dd39740c50acba0395..89079b7a9be1843afead29a33f523c85fb32ab9e 100644 (file)
@@ -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),
index ebf858b47b44678627673bada773d6b6227df63e..5f78a07ee67534bc29975c39262fc5d8d359bdb1 100644 (file)
@@ -123,7 +123,6 @@ class PackageManager:
             "--bind", "/var/tmp", "/buildroot/var/tmp",
             *apivfs_options(),
             *cls.options(root="/buildroot"),
-            "--",
         ]  # fmt: skip
 
     @classmethod
index 626256474aa73fca0336f8933b8f468e949da53e..fb483319d82e55c365ecc4ae2049ca2ec5fa33e0 100644 (file)
@@ -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: