[augeas-devel] More powerful path expressions

David Lutterkort lutter at redhat.com
Mon Jan 26 05:41:13 UTC 2009


This series of patches greatly expands the expressiveness of path
expressions used to reference nodes in the tree.

The syntax follows XPath closely, though it is still a fairly small subset
of XPath.

Some of the path expressions that are now understood are below; simply run
'match' with each of them to try them out:

  /augeas//error  - find all error nodes anywhere in the /augeas subtree

  /files/etc/hosts/*[ipaddr = '127.0.0.1']/canonical - the
    canonical hostname associated with ipaddr 127.0.0.1 in /etc/hosts

  /files/etc/pam.d/*[.//module = "system-auth"] - all pam entries
    that use the module 'system-auth'

More examples and explanations can be found in doc/xpaths.txt (patch 02/11)
and in the file tests/xpath.tests (patch 04/11)

The meat of the patch series is patch 04/11 - for review purposes, it's
probably best to look at the files after applying the patch. It replaces
the interpreter for path expressions in src/pathx.c with a completely new
one (though you'd never tell from the diff)

My plan is to commit this patch series _after_ releasing the current master
branch as version 0.3.6; the release after that will probably be 0.4.0.

I would highly appreciate any comments/review on these patches - anything
from trying the new path expressions out to close scurtiny of the code.

David




More information about the augeas-devel mailing list