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

Raphaël Pinson raphael.pinson at camptocamp.com
Wed Nov 28 11:08:48 UTC 2018


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20181128/bc323b38/attachment.htm>


More information about the augeas-devel mailing list