help-cfengine
[Top][All Lists]
Advanced

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

Re: Convergence and ReplaceAll


From: clemens fischer
Subject: Re: Convergence and ReplaceAll
Date: 30 Mar 2003 20:13:57 +0200
User-agent: Gnus/5.090017 (Oort Gnus v0.17) Emacs/21.3.50 (berkeley-unix)

Chip Seraphine <address@hidden>:

>       BeginGroupIfNoMatch 
> "[[:space:]]*COREADM_GLOB_PATTERN=/var/core/core.\%f.\%u-\%p$"
>               ReplaceAll "^[[:space:]]*COREADM_GLOB_PATTERN=.*$"
>                 With "COREADM_GLOB_PATTERN=/var/core/core.%f.%u-%p"
>
>       cfengine:mingle: WARNING: Non-convergent edit operation ReplaceAll 
> [COREADM_GLOB_PATTERN=/var/core/core.?f.?u-?p] With 
> [[[:space:]]*COREADM_GLOB_PATTERN=.*$]
>       cfengine:mingle: Line begins [COREADM_GLOB_PATTERN=]
>       cfengine:mingle: Replacement matches search string and will thus 
> replace every time - edit was not done
>       cfengine:mingle: Error editing file /etc/coreadm.conf

look at your replace-pattern (search pattern!).  i'm surprised
cfengine sees that: it matches your replacement.  so the search
pattern would match the replacement again and this is a loop!  at
least, this is what i see here.  can't you make the search pattern
more specific, so that replace loop can't occur?

> I would understand this if I didn't have the BeginGroupIfNoMatch
> block.  Is the problem that the interpreter doesn't realize the
> Group stuff protects us from nonconvergent behavior, or am I just
> totally misunderstanding something?  And how does everybody else
> deal with this sort of problem?

well, the problem appears if the group condition matches, to me the
error is obvious.  can you perhaps use an insert instead of the
replace operation?

  clemens




reply via email to

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