[augeas-devel] RFC: Augeas Check function
David Lutterkort
lutter at redhat.com
Tue Jan 13 07:43:27 UTC 2009
On Mon, 2009-01-12 at 13:59 -0500, Bryan Kearney wrote:
> David Lutterkort wrote:
> > On Fri, 2009-01-09 at 13:34 -0500, Bryan Kearney wrote:
> >
> > I've been meaning to change that so that you can do something like
> > set /augeas/save overwrite
> > save
> > .. more changes to the tree ..
> > set /augeas/save backup
> > save
> > so that the first batch of changes just overwrites existing files, and
> > the second also saves .augsave files.
> >
> > With that model, we'd add another option for /augeas/save, say 'check'
> > or 'none' and do what your aug_check call does. With that, we wouldn't
> > need to add another API call, and the implementation would just be a few
> > additional lines in aug_save and tree_save.
> >
> > What do you think about approaching it that way ?
> >
> > David
>
>
> David:
>
> Please take a look at this branch:
>
> http://github.com/bkearney/augeas/tree/flags
>
> It implements the feature mostly per our discussion. Couple of things:
This looks pretty good. I'll make a couple small changes and pull that
into my tree tomorrow.
> 1) I made noop into a first class flag, as it seemed odd to have part of
> the flag->text public and the other half not.
The reason I don't want to add this flag is that I feel all the
AUG_SAVE_* flags were a mistake in the public API, and
modifying /augeas/save should be the way to influence that going
forward.
> 2) in aug_save the logic causes some of the initial flag values to be
> lost. Since some of the flags effect saving and some do not, the
> "correct" way would be to toggle on the bits which effect saving or to
> split out the flags into save versus init. I figured you would not want
> to do the latter.. and I would hold off on the former to make sure this
> approach passed muster.
I'll fix that when I pull the patch in. It also needs to check that
(a) /augeas/save is still there and (b) has a non-NULL value; in fact,
if /augeas/save is not there or nor set to one of the four fixed values,
aug_save should fail with an error.
David
More information about the augeas-devel
mailing list