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

David Lutterkort dlutter at redhat.com
Fri Aug 1 21:10:34 UTC 2008


On Fri, 2008-08-01 at 21:56 +0200, Raphaël Pinson wrote:


> 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...

I think so ... I'd much rather stick with a last_created node;
last_modified doesn't add anything the caller doesn't know already.

The calls that might set something in last_created (aug_set, aug_mv,
aug_insert) should probably also set last_created to NULL if they didn't
create anything. Seems like the cleanest solution to me.

David






More information about the augeas-devel mailing list