<div class="gmail_quote">On Wed, Aug 1, 2012 at 7:57 PM, David Lutterkort <span dir="ltr"><<a href="mailto:lutter@redhat.com" target="_blank">lutter@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Wed, 2012-08-01 at 10:54 +0200, Raphaël Pinson wrote:<br>
> ---<br>
>  src/augeas.c           |   26 ++++++++++++++++++++++++++<br>
>  src/augeas.h           |   10 ++++++++++<br>
>  src/augeas_sym.version |    1 +<br>
>  src/augrun.c           |   34 +++++++++++++++++++++++++++++++++-<br>
>  src/augtool.c          |    2 +-<br>
>  tests/run.tests        |   35 +++++++++++++++++++++++++++++++++++<br>
>  tests/test-api.c       |   17 +++++++++++++++++<br>
>  7 files changed, 123 insertions(+), 2 deletions(-)<br>
<br>
</div>ACK, with one minor nit: there's no semicolons after functions in C (see<br>
below)<br>
<br></blockquote><div><br><br>Somehow, I think I have seen functions followed by semi-colons in the code, so I did the same. I'll check again and remove them...<br><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I also wonder if requiring that SRC matches exactly one node is too<br>
strict - if somebody wants to 'rename /files/etc/hosts//ipaddr address'<br>
we should let them, I think.<br>
<br></blockquote><div><br>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?<br>
<br><br>Raphaël<br><br><br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
> diff --git a/src/augrun.c b/src/augrun.c<br>
> index 7895252..22627ef 100644<br>
> --- a/src/augrun.c<br>
> +++ b/src/augrun.c<br>
> @@ -547,7 +547,7 @@ static void cmd_mv(struct command *cmd) {<br>
>      if (r < 0)<br>
>          ERR_REPORT(cmd, AUG_ECMDRUN,<br>
>                     "Moving %s to %s failed", src, dst);<br>
> -}<br>
> +};<br>
<br>
</div>No semicolon here<br>
<div class="im"><br>
> +static void cmd_rename(struct command *cmd) {<br>
> +    const char *src = arg_value(cmd, "src");<br>
> +    const char *lbl = arg_value(cmd, "lbl");<br>
> +    int r;<br>
> +<br>
> +    r = aug_rename(cmd->aug, src, lbl);<br>
> +    if (r < 0)<br>
> +        ERR_REPORT(cmd, AUG_ECMDRUN,<br>
> +                   "Renaming %s to %s failed", src, lbl);<br>
> +};<br>
<br>
</div>or here<br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
augeas-devel mailing list<br>
<a href="mailto:augeas-devel@redhat.com">augeas-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/augeas-devel" target="_blank">https://www.redhat.com/mailman/listinfo/augeas-devel</a><br>
</div></div></blockquote></div><br>