On Fri, Nov 14, 2003 at 10:46:35AM +1100, Matthew Palmer wrote: > What's to heavily modify? I presume the config file is a fairly reasonable > format, in which case a search 'n replace for 'config_option\s=.*$' to > 'config_option = <new value>' would appropriately modify the file to suit > your needs.
The default config file looks like this: =-=-=-= $i=0 conf[$i]['host'] = 'foo' /* A comment */ conf[$i]['port'] = 'bar' /* A comment */ $i++ conf[$i]['host'] = 'whatever1' conf[$i]['port'] = 'whatever2' =-=-=-= In this case, the same entry appears multiple time. I need to change the config file so it fits my needs by replacing '$i' by '0' for the first instance. I also need to move the comments to separate lines. It is not a hard job, I just don't keep the config file from upstream and that is not a big problem. > Unfortunately, if the user decides to modify the conffile at some later > point, your upgrades will tend to blow away those changes if the user hasn't > used debconf to make the change. This is what I would like to avoid and need to research the subject so I don't reinvent the wheel while not trying to solve a problem that other people (more experienced) deemed impossible to solve. > [md5sums on conffiles.] I like that. This is a good idea and fairly simple to implement. In which package can I find an example of this? > > Is it a common practice to modify a configuration file by adding keywords > > and placeholders so upgrades and reconfigure run smoothly? > > It's done, but it's by no means recommended unless you can't avoid it. So basically, you don't keep track of user changes and make sure that their modifications stays. What happen when new configuration parameters appears in a new upstream release? I guess you can stuck them in there without touching the rest of the configuration? You can warn the user about it too. David. -- David Segonds - PGP 0x1F7A3E7A
pgp00000.pgp
Description: PGP signature