[augeas-devel] Re: Lens similar to rsync.conf

Marc Fournier marc.fournier at camptocamp.com
Tue May 26 08:36:42 UTC 2009


Hello,

> I need to make an adapter for a config file that's almost identical to
> rsync but sections are expressed differently:
> 
>  
> 
> Toplevelrecord = val
> 
> Section/record = val2
> 
> Subsection/section/record=val3
> 
>  
> 
> Scanning the man page, rsync doesn't seem to do subsections, but
> otherwise the equivalent rsync could be:
> 
>  
> 
> <pre>
> 
> rsync.conf
> 
>  
> 
> Toplevelrecord = val
> 
> [Section]
> 
> record = val2
> 
> </pre>

I'm not sure I understand how "Subsection/section/record=val3" would be
expressed in your config file. How do you differentiate a section from a
subsection ? Could you maybe show us an example ?



> I tried to start by matching the regex like so:
> 
> [A-Za-z0-9 _.-\/]
> 
>  
> 
> But I get:
> 
> lenses/localconf.aug:33.0-38.24:Failed to compile entry
> 
> lenses/localconf.aug:34.17-.23:exception: The key regexp
> /[A-Za-z0-9_.-][A-Za-z0-9 _.-\/]*[A-Za-z0-9_.-]/ matches a '/'

Maybe this is because "/" is used as a separator to distinguish a
section from a record ?

Any augeas specialist around ?


Marc





More information about the augeas-devel mailing list