[augeas-devel] Use of Record Sequences
Bryan Kearney
bkearney at redhat.com
Thu Feb 28 15:59:46 UTC 2008
David Lutterkort wrote:
> On Tue, 2008-02-26 at 13:23 -0500, Bryan Kearney wrote:
>> I have not read through Bison and Flex yet, so this discussion may be
>> from ignorance. Is it possible to use one of the record labels as the
>> unique key?
>
> Yes, you can. That's what the key lens does, an example of that is in
> yum.aug. 'key RE' for some regular expression RE matches that regular
> expression against the file during parsing and uses it as the label of
> the enclosing tree (marked with '[' .. ']')
So.. can I assume the best practice would be to use the sequence iff
there is no logical key?
>
> Since many config files don't have natural primary keys for their
> entries, Augeas lets you generate synthetic keys with 'seq NAME' and
> then find entries with match. For example, to find the entry for
> initdefault in /etc/inittab, you'd do
>
> match /system/config/inittab/*/action initdefault
>
I guess I am achoring on xPath.. so this would match all the action
nodes. Is that the expected bahaviour?
-- bk
More information about the augeas-devel
mailing list