[augeas-devel] Augeas lens for Debian control file

David Lutterkort lutter at redhat.com
Wed Mar 3 00:12:27 UTC 2010


On Tue, 2010-03-02 at 09:35 +0100, Dominique Dumont wrote:
> On Friday 26 February 2010 19:49:21 David Lutterkort wrote:
> > Ok .. you convinced me. I pushed the lens as-is - the only downside of
> > using autoload here is that in the default setup, Augeas will try to
> > find the file /control. That is not much of a problem right now, and
> > hopefully will never be.
> 
> May be a notion of context is needed here for augtool (or libaugeas):
> - look for files in /etc in sysadmin context 
> - look for files in ~/.* in user context
> - look for files in . in application context 
> 
> If a lens is tied to a context, it can be used only for the roght set of 
> files.
> 
> Now, the trick is to find the context. EUID can be used to find sysadmin 
> context, bit I don't know how to distinguish between user and application 
> context....
> 
> Thoughts ?

That seems very similar to setting a root + selectively turning some
autoloads on and off. To make that really fly, we'd have to add an 'if'
construct to the lens language - I'd be fine with patches that let you
make decisions in the lens language based on entries in the tree.

I do not want to hardcode anywhere that, e.g., files should be looked
for in /etc - that's not really what 'sysadmin context' implies to me,
since there are already files (e.g. /boot/grub/menu.lst) outside
of /etc, and people should be able to easily add lenses for files
in /opt etc.

David





More information about the augeas-devel mailing list