Retrieving last modified node path (Was: [augeas-devel] First tests with aug mv)

Raphaël Pinson raphink at gmail.com
Fri Aug 1 19:56:24 UTC 2008


On Fri, Aug 1, 2008 at 8:01 PM, David Lutterkort <dlutter at redhat.com> wrote:

>
> Basically that I can only come up with a fully qualified path (i.e. a
> path that only references a single node) for aug_set, aug_mv and
> aug_insert - I don't know how to make that work for aug_rm. Maybe best
> to ignore aug_rm for last_modified.
>
> Maybe it's better to break this into two questions: was a node created
> during a aug_set/aug_mv/aug_insert ? and what is the path to the node
> that aug_set/aug_mv/aug_insert modified/created ?
>
> Whether a node was created is always true for aug_insert, and could be
> indicated with the return value from aug_set and aug_mv. What node was
> affected could be indicated with /augeas/tree/last_modified as the table
> suggests.
>
> Does that make it clearer ?


Or to have both last_modified_node and last_created_node. last_modified_node
would would refer to the input PATH in the cases of aug_set, aug_mv,
aug_rm... last_created_node would refer to the exact PATH of the last
created node. Is it possible for a command to create more than one node in a
go (I don't see how it would happen)?


So there would be something like


  Previous call    m (the modfied path)   ;    c (the created path)
       aug_init     - NULL; NULL
       aug_get      - no influence on value of /augeas/tree/last_modified;
no influence on value
       of /augeas/tree/last_created
       aug_set      - PATH passed to aug_set, fully qualified ; resulting
PATH, only if the path was created
       aug_insert   - fully qualified path to newly created node (or empty -
nothing was _modified_ so to say?) ; fully qualified path to newly created
node
       aug_rm       - PATH passed to aug_rm ; NULL
       aug_mv       - PATH passed to aug_mv as DST argument ; PATH, only if
the path was created
       aug_match    - no influence on value of /augeas/tree/last_modified ;
no influence on value of /augeas/tree/last_created
       aug_save     - either leave /augeas/tree/last_modified unchanged or
set to NULL ; either leave /augeas/tree/last_created unchanged or set to
NULL
       aug_print    - no influence on value of /augeas/tree/last_modified ;
no influence on value of /augeas/tree/last_created


Perhaps that makes the whole thing a bit too complicated though...



Raphael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20080801/c8425bc5/attachment.htm>


More information about the augeas-devel mailing list