[augeas-devel] [PATCH 0/2] #216: Support path contexts
Dominic Cleal
dcleal at redhat.com
Sun Nov 6 11:39:50 UTC 2011
This patch attempts to address #216, supporting a root context for all relative
paths passed into the API.
It was intended to mirror Puppet's "context" property, but implemented in
Augeas itself so relative paths can be passed into aug_srun.
Relative paths are defined as those that don't start with "/" or "//" (the
latter to keep backwards-compatibility, will always refer to a descendant of
root).
The context is stored in /augeas/context and can be modified with the usual
commands. It's parsed as a full path expression, but must evaluate to a single
node. It defaults to "/files".
The second patch makes tab completion work in augtool as a user might expect,
so it's aware now of the context.
Feedback's appreciated.
Thanks,
Dominic
src/augeas.c | 84 +++++++++++++++++++++++++++++++++++++++++------------
src/augeas.h | 2 +-
src/augtool.c | 34 +++++++++++++++++++--
src/builtin.c | 2 +-
src/internal.h | 18 +++++++++++-
src/pathx.c | 48 +++++++++++++++++++++++++++++-
src/transform.c | 4 +-
tests/test-api.c | 48 ++++++++++++++++++++++++++++++
tests/xpath.tests | 7 ++++
9 files changed, 218 insertions(+), 29 deletions(-)
More information about the augeas-devel
mailing list