]> git.ipfire.org Git - thirdparty/mkosi.git/commit
Rework ini file parsing 1845/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 28 Aug 2023 11:24:59 +0000 (13:24 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 1 Sep 2023 08:32:41 +0000 (10:32 +0200)
commit083135363be859070aff75ffb3b4503339464c4b
tree851f436e07b0c1f5d1badfaf812dec8cc91c0cfa
parenta038a5e0f800a5914bcd3ecf0547f22f5d8a26f1
Rework ini file parsing

Python's configparser module is rather inadequate for our purposes.
Specifically, it's built around every setting only being specified once
in a config file and even though we got it to kind of parse more than
one of the same setting with our own custom dict type, there's a lot of
limitations involved. Specifically, assigning the empty value is
impossible with the current approach. To avoid all these issues, let's
introduce our own ini parser.

This also splits off the matching logic into a new method match_config()
and moves setting the debugging level just after we've parsed CLI options
so we get debug messages from the parser as well.
mkosi/__main__.py
mkosi/config.py
tests/test_config.py