-
Notifications
You must be signed in to change notification settings - Fork 123
ini plugin makes hierarchies flat #138
Comments
Currently only directories are serialised to sections. This is due to historical reasons (former treatment of keys with |
What is the intended behaviour? With only inner keys becoming sections, empty sections would not be possible anymore. For example, what if the kdb contained something like this
According to your example the expected outcome would be
But due to the missing subkey, yacy is no longer an inner key, but a leaf key now. |
Hello, You wrote:
Does INI support arbitrary depth? If not its straight forward: keyDirectBelow parentKey are sections, others are
Thats the general topic of dir2leafvalue, see #106. One has to remember if a dir2leafvalue is a quite important topic: many serializations have these best regards |
- #138 now breaks test cases, temporarily commented out - added everything needed for dir (untested)
Any progress here? I removed keyIsDir (because the name is needed for the dir-namespace). So unit tests are now broken in ini, because it wrongly relied on keyIsDir. (I temporarily commented out the comparision between files) Instead it should rely on the key's position below parentKey. Can you fix it for the release 0.8.11? |
What is the planned release date for 0.8.11? |
Hello, You wrote:
Asap, hopefully before the 5th. |
First of all: sorry for the late response. I wrote an answer 2 days ago, but obviously something went wrong.
This is also problematic because as far as I know INI may contain key value pairs without a section. E.g.
The value could even be empty:
So even using the value as a differentiator is not possible. We could simply reject parsing such INI files, but then we would have yet another incomplete INI parser implementation :(. Unfortunately INI is hardly (if at all) standardized. Another possibility would be to make the behaviour configurable by allowing the user to specify section strategies (e.g. all keys below the parent key are treated as sections). However, this increases the configuration burden and would also be a fair amount of work. Which option do you like best? |
Hello, you wrote:
The plugin "ni" solves this problem that keys without value are sections, with
would be:
w/o
In Elektra empty value != null (without) value. So it should work nicely. Or you can check presence/absence of keys. Shouldn't that be enough already? |
@markus2330 Is there currently any way to unescape a key name? My problem is that currently an ini key I would even more prefer to already have a way to set the key name unescaped. This would allow the ini file
to result in the very intuitive Elektra keyset
(example taken from http://docs.nsclient.org/tutorial/core/index.html) |
Hello, you wrote:
If you find the documentation confusing, please report where which information best regards |
Thank you! There was a lot of progress on this issue. Unfortunately, the import/export shell tests (e.g. tests/shell/check_export.sh) still do not support ini. In the export test case an ini file is generated which has two times the same key. |
Problem still persists. E.g. for structural exporting ini is basically useless:
|
This plugin is getting nasty. Could you provie the file you have mounted at |
You can mount it with the script "mount-info", but here a different export with ni:
ni scrambles the order, so ini would be a nice gain ;) |
Btw. the release is most likely to happen today and this issue is not release-critical. I will merge it if its a small change though. |
Thank you, I will have a look at it!
No matter how nasty it is, I already invested so much work in ini, it would be a shame not to fix it :). |
The plugin is fairly complex already (especially this issue), so I am afraid I won't make it today. |
As discussed, here is a more detailed explanation of the issue: Let me first explain what we would expect from the plugin just to make sure we have the same understanding of its (expected) behavior.
assuming that a call like
(values don't really matter for this issue). No sections are produced because none of the keys below However, the actual output looks like this:
Now that the issue is fully described let me explain why it happens: The bug is caused by the call of In order to fix this issue the ini plugin needs a way to detect whether unescaping needs to be done. The only possible way I could think of up to now is marking escaped keys with a special meta key during the GET phase. However, this would make the ini plugin stateful which I don't really like. |
E.g. I have:
kdb ls system/passwd
Actual outcome (excerpt):
kdb export system/passwd ini
Makes the hierachy flat.
Expected outcome:
The text was updated successfully, but these errors were encountered: