[Top][All Lists]

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

RE: multiple edits on one file?

From: Nielsen, Steve
Subject: RE: multiple edits on one file?
Date: Wed, 19 Jan 2005 18:05:20 -0500

You might also need to use "CatchAbort" in case a previous search failed (which 
causes subsequent editblocks on a particular file to be skipped).


-----Original Message-----
From: Ed Brown [mailto:address@hidden
Sent: Wednesday, January 19, 2005 4:39 PM
To: address@hidden
Cc: cfengine help list
Subject: Re: multiple edits on one file?

Don't know if this is it or not, but if I edit the same file in multiple
editfiles blocks, I always start the blocks with:
ResetSearch "1" 
to set the pointer to the top of the file.


On Wed, 2005-01-19 at 15:04, Don Harper wrote:
> Based on various classes being defined, I want to edit one file.
> Now, given that I have three classes defined in a module
> [HaveGold,HaveBronze, and HaveGranite], I want to do something like
> this:
>  any::
>   { /tmp/file
>      DeleteLinesContaining "/tmp"
>      AppendIfNoSuchLine "LABEL=/local"
>      DeleteLinesContaining "/gold"
>      DeleteLinesContaining "/ "
>      DeleteLinesContaining "/bronze"
>      DeleteLinesContaining "/granite"
>      AppendIfNoSuchLine "LABEL=/v-$(gold)"
>    }
>   HaveBronze::
>    { /tmp/file
>      AppendIfNoSuchLine "LABEL=/v-$(bronze)"
>    }
>   HaveGranite::
>    { /tmp/file
>      AppendIfNoSuchLine "LABEL=/v-$(granite)"
>    }
> Now, the any:: section runs, just like it should.  But, the other two
> never run, even if one or both of the classes are defined.  The classes
> get defined from a module defined, and they are listed in
> AddInstallable.  Any clues?
> Thanks!
> Don

Help-cfengine mailing list

reply via email to

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