From: Daan De Meyer Date: Tue, 23 Apr 2024 07:48:07 +0000 (+0200) Subject: Make sure "mkosi -C build" works X-Git-Tag: v23.1~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcb48a90012b4b8e173863089f83a9f8a93b3671;p=thirdparty%2Fmkosi.git Make sure "mkosi -C build" works 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. --- diff --git a/mkosi/config.py b/mkosi/config.py index 6bb2441e8..bdf547d9e 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -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