<br><div class="gmail_quote">On Wed, Mar 6, 2013 at 4:54 PM, Serge Smetana <span dir="ltr"><<a href="mailto:serge.smetana@gmail.com" target="_blank">serge.smetana@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Raphaël,<br>
<br>
Thank you very much for the comments.<br>
I cannot apply all of them because currently we use Augeas 0.10 but<br>
will make changes for the rest.<br>
<br>
My main question was is there any way to describe keys as regexp<br>
instead of having fixed list and to have lens for the blocks without<br>
"overlapping lenses" exception?<br></blockquote><div><br><br>Sure, you can use regexps for keys. You can write things like:<br><br>    key /(no)?flag/<br><br>or:<br><br>    key /one|two|three/<br><br>for example.<br>
<br><br>As for the blocks, you could have a look at the way keepalived was written before Build.block* constructs were introduced. Keep in mind that Build.block* constructs cost me quite a few hours of headaches to properly cover edge cases, and implementing these cases manually will be hard.<br>
<br><br><br>Raphaël<br><br><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thank you.<br>
<span class="HOEnZb"><font color="#888888"><br>
Serge<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Wed, Mar 6, 2013 at 9:35 AM, Raphaël Pinson<br>
<<a href="mailto:raphael.pinson@camptocamp.com">raphael.pinson@camptocamp.com</a>> wrote:<br>
> Hi Serge,<br>
><br>
><br>
> Great job! I've left some comments on github directly.<br>
><br>
><br>
> Regards,<br>
><br>
> Raphaël<br>
><br>
><br>
> On Tue, Mar 5, 2013 at 7:28 PM, Serge Smetana <<a href="mailto:serge.smetana@gmail.com">serge.smetana@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hello,<br>
>><br>
>> I'm trying to create lens for Dovecot config.<br>
>> I'm already have working lens here:<br>
>><br>
>> <a href="https://github.com/smetana/augeas/commit/0cbd6b88e0f1bf2e281fa3ea16803abbf8b3d770" target="_blank">https://github.com/smetana/augeas/commit/0cbd6b88e0f1bf2e281fa3ea16803abbf8b3d770</a><br>
>><br>
>> But it is too "tight" because of the fixed list of keywords for the<br>
>> entries.<br>
>> Dovecot supports blocks and nested blocks like<br>
>><br>
>> service auth {<br>
>>   unix_listener auth-userdb {<br>
>>      ...<br>
>>   }<br>
>> }<br>
>><br>
>> and if I create wildcarded lens for simple entry<br>
>><br>
>>    let entry = [ indent . key Rx.word. eq . (store value)? . eol ]<br>
>><br>
>> I am unable to create lens for the block<br>
>><br>
>>    let block_names = ("protocol" | "service" | "plugin" | "namespace" |<br>
>> "map" )<br>
>>    let block =<br>
>>        [ indent . key block_names . block_args? . block_open . eol<br>
>>        . (entry | empty | comment)*<br>
>>        . indent . block_close . eol ]<br>
>><br>
>> I end up with exception: overlapping lenses in tree union.put<br>
>>     Example matched by both:  { "protocol" }<br>
>><br>
>> Is there any way to define possible keys as something like a<br>
>> subsctraction (Rx.word - block_names)<br>
>> meaning "match anything but not /protocol|service|map/"?<br>
>><br>
>> Thank you!<br>
>> Great job!<br>
>><br>
>> Serge<br>
>><br>
>> _______________________________________________<br>
>> augeas-devel mailing list<br>
>> <a href="mailto:augeas-devel@redhat.com">augeas-devel@redhat.com</a><br>
>> <a href="https://www.redhat.com/mailman/listinfo/augeas-devel" target="_blank">https://www.redhat.com/mailman/listinfo/augeas-devel</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Raphaël Pinson<br>
> Administrateur Systèmes & Réseaux<br>
> Camptocamp France<br>
> Savoie Technolac<br>
> BP 352<br>
> 48, avenue du Lac du Bourget<br>
> 73372 Le Bourget du Lac, Cedex<br>
> <a href="http://www.camptocamp.com" target="_blank">www.camptocamp.com</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Raphaël Pinson<br>Administrateur Systèmes & Réseaux<br>
Camptocamp France<br>
Savoie Technolac<br>
BP 352<br>
48, avenue du Lac du Bourget<br>
73372 Le Bourget du Lac, Cedex<br>
<a href="http://www.camptocamp.com" target="_blank">www.camptocamp.com</a><br>