On 13 Mar 2003, Lars Gullik Bjønnes wrote: > Christian Ridderström <[EMAIL PROTECTED]> writes: > > | > | Background and goal: > | I've got multiple accounts (several at work, at home and on a laptop), > | but I want to have a similar environment and similarly configured > | software on all the machines. So far I've been using scripts, CVS and > | manual merging... > > template files (similar to .in files in the autoconf world) and use > sed to create the real files...
Thinking out loud: isn't that one way only? I think you mean that I have templates under version control, and then generate the configuration files? Unfortunately, programs love to modify the configuration files (including lyx nowadays :-), and I want to keep some of the changes, and propagate them to my other accounts. Hmm.. I guess that when it's time to see what has happened to my local config-file, I could first do the following. cvs update -p template > template.tmp sed --file=substitutions template.tmp > config.tmp Now I can compare: diff config.tmp config Then I (iteratively) modify 'template.tmp' until the result of sed --file=subsitutions template.tmp > config.tmp looks the way I like it, i.e. it keeps the changes I want. Now I can do mv template.tmp template cvs ci template to put the changes back into the repository. And then I have to repeat this on all machines. This would probably have been easier to explain as 'shooting' in terms of solving intial value problems. Mathematically, this is solving for 'template.tmp' in the "equation": Substitutions( template.tmp ) == config I was rather looking for something that solves it directly: template.tmp := SubstitutionsInverse(config) Preferably, 'cvs diff config' would be translated into: template := SubstitutionsInverse(config) cvs diff template and 'cvs up config' would translate into: cvs up template config := Substitutions(template) and so forth. Hmm, the operator 'sed --file=substitutions' maps to Substitions, and it's inverse could map to say 'sed --file=substitutionsInverse', then maybe I can do this with just templates and sed... making both the files "substitions" and "substitionsInverse" isn't that much work... Thanks Lars, I don't know if this is exactly what you meant, but it might be useful for me. /Christian -- Christian Ridderström http://www.md.kth.se/~chr