[augeas-devel] Wildcarded key/value pairs and nested blocks (dovecot lens development)

Raphaël Pinson raphael.pinson at camptocamp.com
Wed Mar 6 07:35:26 UTC 2013


Hi Serge,


Great job! I've left some comments on github directly.


Regards,

Raphaël


On Tue, Mar 5, 2013 at 7:28 PM, Serge Smetana <serge.smetana at gmail.com>wrote:

> Hello,
>
> I'm trying to create lens for Dovecot config.
> I'm already have working lens here:
>
> https://github.com/smetana/augeas/commit/0cbd6b88e0f1bf2e281fa3ea16803abbf8b3d770
>
> But it is too "tight" because of the fixed list of keywords for the
> entries.
> Dovecot supports blocks and nested blocks like
>
> service auth {
>   unix_listener auth-userdb {
>      ...
>   }
> }
>
> and if I create wildcarded lens for simple entry
>
>    let entry = [ indent . key Rx.word. eq . (store value)? . eol ]
>
> I am unable to create lens for the block
>
>    let block_names = ("protocol" | "service" | "plugin" | "namespace" |
> "map" )
>    let block =
>        [ indent . key block_names . block_args? . block_open . eol
>        . (entry | empty | comment)*
>        . indent . block_close . eol ]
>
> I end up with exception: overlapping lenses in tree union.put
>     Example matched by both:  { "protocol" }
>
> Is there any way to define possible keys as something like a
> subsctraction (Rx.word - block_names)
> meaning "match anything but not /protocol|service|map/"?
>
> Thank you!
> Great job!
>
> Serge
>
> _______________________________________________
> augeas-devel mailing list
> augeas-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/augeas-devel
>



-- 
Raphaël Pinson
Administrateur Systèmes & Réseaux
Camptocamp France
Savoie Technolac
BP 352
48, avenue du Lac du Bourget
73372 Le Bourget du Lac, Cedex
www.camptocamp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20130306/b4c987b3/attachment.htm>


More information about the augeas-devel mailing list