[augeas-devel] Help regarding union.put overlap with INI-like format

Raphaël Pinson raphael.pinson at camptocamp.com
Wed Nov 28 13:05:07 UTC 2018


Here's my take on it, which passes the tests, except for the empty
variable, which I've mapped to no value, as done in other INI lenses:

https://github.com/hercules-team/augeas/compare/master...raphink:semanage

On Wed, Nov 28, 2018 at 12:08 PM Raphaël Pinson <
raphael.pinson at camptocamp.com> wrote:

>
>
> On Wed, Nov 28, 2018 at 12:02 PM Pino Toscano <ptoscano at redhat.com> wrote:
>
>> On Wednesday, 28 November 2018 10:06:18 CET Raphaël Pinson wrote:
>> > Your example does not correspond to
>> >
>> >     (entry | record)*
>> >
>> > Rather, it corresponds to
>> >
>> >     entry* . record*
>> >
>> > since entries inside records are not independent.
>> >
>> > Also, you're missing comment support:
>> >
>> >     (comment | entry)* . record*
>>
>> Hmm most probably I did not explain correctly: [end] is not the start
>> of a new group called "end", but it's the closing tag for a group.
>>
>
>
> Yes, that was quite clear.
>
>
>
>> So back to my example:
>>
>> | foo=var
>> | [group1]
>> | var=value
>> | [end]
>> | foo2=var2
>> | [group2]
>> | var=value
>> | [end]
>>
>> there are:
>> - a un-grouped entry "foo" with value "var"
>>
>
> which is mapped by "entry"
>
>
>> - a group "group1" with a "var" entry
>> - a un-grouped entry "foo2" with value "var2"
>>
>
> Ah, I did not catch that! So indeed, you need a mix of entries and
> records, but then you will have to make sure they don't collide in their
> definitions.
>
> I've seen some horrible config formats when writing Augeas lenses, but
> there's still some… unexpected surprises…
>
>
> --
> Raphaël Pinson
> Infrastructure Developer & Training Leader
> +41 21 619 10 65
>
> Camptocamp SA
> EPFL Innovation Park, Bât A
> 1015 Lausanne
>
> www.camptocamp.com
>


-- 
Raphaël Pinson
Infrastructure Developer & Training Leader
+41 21 619 10 65

Camptocamp SA
EPFL Innovation Park, Bât A
1015 Lausanne

www.camptocamp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20181128/9b55aa8f/attachment.htm>


More information about the augeas-devel mailing list