On Mon, 2019-11-04 at 13:19 +0100, Thorsten Kukuk wrote:
The problem I see with libeconf is that, as far as I understood, it only supports key=value configuration files (as it is stated in the project's README[2]). That's fine for many configuration files (like sysconfig, login.defs, etc.), but I am not sure whether it will be good enough for other cases (ini files -having sections into account-, YAML- like (Salt), JSON (docker), etc.).
The whole stuff makes only sense with ini style files.
OK, I see. I was simply thinking about a wider solution.
Why not using augeas (or any other similar library) to parse the files instead of rolling our own? libaugeas and its lenses are quite small.
The parser is far the smallest part, and we haven't found anything which is merging the configuration files in the way we need it (the systemd developer were not willing to provide their code as standalone library or make the interface public).
Well, what we do in YaST is to use the parser to read (and write) the information from those files and merge the content ourselves. We use a tree-like structure that can be replaced with any other thing if needed or modified in a per-application fashion. In this case, we might rely on libeconf when it is good enough and reach for augeas when needed. Thanks. -- Imobach González Sosa YaST Team at SUSE LINUX GmbH https://imobachgs.github.io/