V Tue, 5 Nov 2019 19:40:08 +0100 Thorsten Kukuk <kukuk@suse.de> napsáno:
On Tue, Nov 05, Josef Reidinger wrote:
V Mon, 4 Nov 2019 13:19:29 +0100 Thorsten Kukuk <kukuk@suse.de> napsáno:
The whole stuff makes only sense with ini style files.
Hi thorsten, I am a bit lost here. Do you mean with this statement that libeconf makes sense only with ini files? Or that whole /usr/etc is intended for ini files? Or that merging makes sense only for ini files?
The merging of several snippets to one file makes only sense for some formats, most likely ini files. It's pretty hard for some other files like yaml or json.
What is exactly difference in data format that prevent merging? For it is not much difference if file1: A => 1, B => 2 file2: A => 3 file3: C => 4 result: A => 3, B => 2, C => 4 depends on format. So I still do not see how merging and configuration format is related together.
So while the /usr/etc move makes sense for all configuration files, the best solution for every single file really depends on the format of the configuration file, there is no "this library will solve all use cases".
That is why I think that best approach is to provide reasonable default and allow to redefine strategy for merging when it makes sense for user. In our POC we basically do simple replace as I did above when merging multiple files, but allow user to redefine it if there is specific behavior needed ( like concating values for keys, strange precedence, etc ). This way it is easy to use for us and also does not block us when we need more complicated strategy. Josef
Thorsten
-- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org