[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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

Hi Pino.

> The lens (attached) seems to work fine, [...]
I don't think you attached the right file. Simplevars.aug is shipped with Augeas and your attachment looks identical to that. 
Semanage.aug, which caused the compilation error, is not attached, right?


-----Original Message-----
From: augeas-devel-bounces redhat com <augeas-devel-bounces redhat com> On Behalf Of Pino Toscano
Sent: Tuesday, November 27, 2018 1:49 PM
To: augeas-devel redhat com
Subject: [augeas-devel] Help regarding union.put overlap with INI-like format


I'm writing a new lens to parse the configuration file /etc/selinux/semanage.conf, currently handled by the Simplevars lens.
The problem is that this file does not have anymore a simple foo=var syntax, and grew INI-like "groups" which Simplevars does not 

The syntax is like (attached there is the default file in Fedora):

# comment
[name of group]
var = value
[end]  # yes, a group is ended like this

I tried to model a new lens that would return the very same structure that Simplevars exposed, just with the additional subtrees for 
the groups, to not break existing users.  The lens (attached) seems to work fine, although the typechecking with augparse shows 
union.put overlapping issues:

$ augparse --nostdinc -I lenses/ lenses/tests/test_semanage.aug Syntax error in lens definition lenses/semanage.aug:36.0-.27:Failed to 
compile lns
lenses/semanage.aug:36.10-.25:exception: overlapping lenses in tree union.put
    Example matched by both:  { "AA" }
    First lens: lenses/semanage.aug:30.12-31.17:
    Second lens: lenses/semanage.aug:34.13-.60:

lenses/tests/test_semanage.aug:16.5-.17:Could not load module Semanage for Semanage.lns 
lenses/tests/test_semanage.aug:16.5-.17:Undefined variable Semanage.lns lenses/tests/test_semanage.aug:25.5-.17:Undefined variable 
Semanage.lns lenses/tests/test_semanage.aug:30.5-.17:Undefined variable Semanage.lns lenses/tests/test_semanage.aug:56.5-.17:Undefined 
variable Semanage.lns

I tried to debug this a bit, and I understand (thanks to the
documentation!) what is the issue reported... although I do not get why actually augeas finds an overlap here. Any hints?

Pino Toscano

Attachment: smime.p7s
Description: S/MIME cryptographic signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]