[augeas-devel] [PATCH] Add aug_rename to rename node labels without moving them in the tree.

David Lutterkort lutter at redhat.com
Wed Aug 1 19:27:54 UTC 2012


On Wed, 2012-08-01 at 20:17 +0200, Raphaël Pinson wrote:
> On Wed, Aug 1, 2012 at 7:57 PM, David Lutterkort <lutter at redhat.com> wrote:
>
> > I also wonder if requiring that SRC matches exactly one node is too
> > strict - if somebody wants to 'rename /files/etc/hosts//ipaddr address'
> > we should let them, I think.
> >
> >
> That's a good point. Actually, there's another check which might be
> interesting: checking that LBL doesn't contain a /. Would that be good?
> (though you could want to move the node to a subnode in the same
> position...) Is there an internal function I could use to achieve that?

Yes, we should definitely disallow '/' in the new label; a simple check
for 'strchr(lbl, '/') != NULL' will do the trick. Not sure what the
right error in that case is .. EMVDESC is the closest, but we should
probably introduce a new one, say AUG_ELABEL.

I don't think that rename should allow a move.

David





More information about the augeas-devel mailing list