[augeas-devel] Two lenses in the same module

David Lutterkort lutter at redhat.com
Tue Sep 9 00:02:47 UTC 2008


On Mon, 2008-09-08 at 11:43 +0200, Free Ekanayaka wrote:
> Hi,
> 
> I would like to write a postfix.aug module to parse
> 
> /etc/postfix/main.cf
> 
> and
> 
> /etc/postfix/master.cf
> 
> which have fairly different formats. Would it be possible to include
> two different lenses in the module? Like:
> 
> let filter_main 
>    = incl "/etc/postfix/main.cf"
>    . Util.stdexcl
> 
> let filter_master
>    = incl "/etc/postfix/master.cf"
>    . Util.stdexcl
> 
> let xfm
>     = transform lns_main filter_main
>     . transform lns_master filter_master

No, you can't do that right now. If you could do that, you would create
two separate transforms and then have two separate autoload statements
in the module - this is also where this breaks down: the syntax for
autoload is so primitive, that you can only have one. If you could have
multiple autoloads in one module, the above would be possible.

David





More information about the augeas-devel mailing list