]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Emit configfile arguments in key=val format 1080/head
authorJacob Emmert-Aronson <jacob@roadnottaken2718.com>
Wed, 27 Jul 2022 04:43:32 +0000 (21:43 -0700)
committerJacob Emmert-Aronson <jacob@roadnottaken2718.com>
Thu, 28 Jul 2022 02:41:51 +0000 (19:41 -0700)
This ensures that argparse treats all values read from configfiles as
explicit arguments associated with their respective keys, rather than
attempting to parse them as options in their options in their own right.

mkosi/__init__.py
tests/test_config_parser.py

index 0755e1060dace69b1d45b2533e7fb37c3720c6ed..432a9e7f1637db6457e52117ae82e12a7b683e75 100644 (file)
@@ -5005,7 +5005,7 @@ class ArgumentParserMkosi(argparse.ArgumentParser):
                             if cli_arg in action.option_strings:
                                 if isinstance(action, ListAction):
                                     value = value.replace(os.linesep, action.delimiter)
-                        new_arg_strings.extend([cli_arg, value])
+                        new_arg_strings.append(f"{cli_arg}={value}")
             except OSError as e:
                 self.error(str(e))
         # return the modified argument list
index d68e0ed62ee31fb905c3df4122a0af3188b412c4..5b99ba6f868dd159aa66bcb754e6021446406ca2 100644 (file)
@@ -600,7 +600,7 @@ class MkosiConfigManyParams(MkosiConfigOne):
             "Host": {
                 "ExtraSearchPaths": "search/here:search/there",
                 "QemuHeadless": True,
-                "QemuArgs": "-vga none -device virtio-vga-gl",
+                "QemuArgs": "-device virtio-vga-gl -vga none",
                 "Netdev": True,
             },
         }
@@ -734,7 +734,7 @@ class MkosiConfigManyParams(MkosiConfigOne):
             "Host": {
                 "ExtraSearchPaths": "search/debi",
                 "QemuHeadless": True,
-                "QemuArgs": "-nic user,model=virtio-net-pci",
+                "QemuArgs": "-device virtio-vga-gl,xres=1920,yres=1080 -display sdl,gl=on",
                 "Netdev": True,
             },
         }