[augeas-devel] Multiple distinct files of the same format

David Lutterkort dlutter at redhat.com
Thu Apr 24 17:46:30 UTC 2008


On Thu, 2008-04-24 at 12:49 +0100, Dean Wilson wrote:
> There are a number of files that have identical file formats that live
> under /etc and I'd like to see in the augeas tree. What's the best way
> of doing this without adding a lot of duplication in each lense? would
> it make sense to have additional util classes for each kind of format
> (and an associated test case for each) and just have the lense include
> it and the files required for that lense?

Yes, that's probably the best way .. have one module that defines the
lens for such files (say 'single_entry.aug') and then one module for
each type of file you want to separate out; that module would look like

        module Cron_allow_deny
          autoload xfm
          
          let xfm = transform Single_entry.lns 
                       (incl "/etc/cron.allow") . (incl "/etc/cron.deny")
        
Alternatively, you can put everything in one module, and just use a
filter that matches all files of a certain type - though I think it's
cleaner to split along logical lines.

David





More information about the augeas-devel mailing list