]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Make sure "mkosi -C build" works
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 23 Apr 2024 07:48:07 +0000 (09:48 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 23 Apr 2024 08:19:18 +0000 (10:19 +0200)
In systemd we want to (optionally) make sure all mkosi output is
written to the meson build directory. To make this work, we want to
write a mkosi.conf to the meson build directory so that developers
can do "mkosi -C build". Currently this doesn't work because "build"
is interpreted as a verb. Let's make sure that doesn't happen.

We need a better solution for this hack but for now this is the best
I can come up with.

mkosi/config.py

index 6bb2441e87223067d5410ea021edf979011503e9..bdf547d9e5ce64d00d6d091ec92c0aaff37093ad 100644 (file)
@@ -3555,6 +3555,10 @@ def parse_config(argv: Sequence[str] = (), *, resources: Path = Path("/")) -> tu
         except ValueError:
             continue
 
+        # Hack to make sure mkosi -C build works.
+        if argv[v_i - 1] in ("-C", "--directory"):
+            continue
+
         if v_i > 0 and argv[v_i - 1] != "--":
             argv.insert(v_i, "--")
         break