[augeas-devel] put to inittab is order-dependent

David Lutterkort lutter at redhat.com
Tue Oct 23 17:28:09 UTC 2012


On Tue, 2012-10-23 at 10:06 +0100, Matthew Booth wrote:
> Augeas's strictness is both its strength and its curse, and this is 
> another example. The problem is that augeas's domain is right there in 
> the name: shovelling sh*t. Sh*t isn't that strict ;)

And if you don't want to get too dirty in the process, you need to wear
protection, lots of it ;)

>  I *want* augeas to 
> be more DWIM, which I feel is more appropriate for the domain. I wonder 
> how far we can push it in that direction without completely giving up 
> the power of its strictness.

In this particular example, you want a 'canonizer' or 'quotient
lens'[1], i.e. something that implicitly normalizes the tree by sorting
certain nodes before doing a put.

The problem you're running into is caused by the fact that Augeas trees
are ordered (just like DOM's), and they are ordered, because the text
files we're ultimately interested in are also ordered.

Besides a node-sorting canonizer, there are lots of other constructs
that would be very useful in writing lenses: e.g., an easy way to
describe permutations of lenses (e.g., for handling command line options
that are sometimes embedded in files) or, more generally, an interleave
operator similar to RelaxNG. Patches for any of these are more than
welcome ;)


David

[1] http://www.cs.cornell.edu/~jnfoster/papers/quotient-lenses.pdf
    and
http://www.cs.cornell.edu/~jnfoster/papers/quotient-lenses-slides.pdf





More information about the augeas-devel mailing list