help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: editfiles complexity


From: Tim Nelson
Subject: Re: editfiles complexity
Date: Thu, 19 Feb 2004 17:23:56 +1100 (EST)

On Sun, 25 Jan 2004 Mark.Burgess@iu.hio.no wrote:

> Sorry that I have not come back to this. It will take me a while
> to start up this discussion. I am in the middle of a few intensive
> weeks of visitors and travelling lectures :) Please let me
> come back to this in a couple of weeks.

        Any chance at giving this a go now?  :)

> On 20 Jan, Systems Administrator wrote:
> > On Mon, 19 Jan 2004 Mark.Burgess@iu.hio.no wrote:
> >
> >> The main constraint on editfiles is that operations should be convergent.
> >> This means that one should not split the commands into something looking
> >> like "perl" or "C" as you suggest in
> >>
> >>  IF [No(t)] <condition> [Parameters] DO <action> [Parameters]
> >
> >     Can you give me an example of something non-convergent that the
> > current structure does a good job of preventing?  Or is it a matter of
> > mindset?  (I assume the second for the rest of this e-mail).  What's the
> > difference between all the current editfiles statements containing the
> > word "If", and my suggestion above?
> >
> >>
> >> But perhaps something equivalent can be done. Like renaming the
> >> commands hierarchically.
> >>
> >>   <condition>.<action>(parameters)
> >
> >     Hmm.  That might work.  From what I can see, you're basically
> > allowing the same thing, but trying to get people to think convergently
> > about it.  Would it be more cfenginely if we had:
> >
> >     <condition> = ( <actions> )
> >
> >     Or maybe if we didn't call it "IF".
> >
> >     WHERE [No(t)] <condition> [Parameters] DO <action> [Parameters]

        ...or even

        ([No(t)] <condition> [Parameters]):
                <action> [Parameters]

        eg.

        LineMatching /^FredsPig/:
                ReplaceWith "JohnsPigsWoowoowoo"

        Is that more cfenginly?

> >     Or maybe we're not thinking convergently about the whole
> > editfiles thing.
> >
> >     Btw, it might be cool to have an "onlyone" option, so that you can
> > say the comment below.
> > -----
> > If x matches y, then z should be true, but there should only be one line
> > where x matches y.
> > -----
> >
> >     Of course, that's not a syntax suggestion :).
> >
> >     Eagerly await the next installment,
> >
> >     :)

--
Tim Nelson
Systems Administrator
Sunet Internet
Tel: +61 3 5241 1155
Fax: +61 3 5241 6187
Web: http://www.sunet.com.au/
Email: sysadmin@sunet.com.au







reply via email to

[Prev in Thread] Current Thread [Next in Thread]