Brendan Strejcek wrote: > This is a commonly requested feature, check the archives for the > discussions. > > This is what I find myself doing these days: > > editfiles: > { /some/file > DeleteLinesStarting "SomeVar" # Or Matching, whatever > AppendIfNoSuchLine "SomeVar = SomeValue" > } > > This is perfectly convergent because cfagent edits the file in a buffer > and then compares to contents on disk. If there is no difference, the > actual file is not touched.
This is an improvement, but it would be nice if the edit did not move the line you are editing to the end of the file. Usually there is some context of comments related to the variable you are setting. The function which edits and sets the variable should not change this. This makes it easier to look through the file if needed to find the line you are looking for, to see what the settings are, and to reference the information in the comments. Scott -- * David Scott Coburn * Brookhaven National Laboratory * [EMAIL PROTECTED] 631.344.7110 * "Assume a spherical cow of uniform density..." _______________________________________________ Help-cfengine mailing list Help-cfengine@gnu.org http://lists.gnu.org/mailman/listinfo/help-cfengine