On Wed, Nov 12, 2003 at 04:48:51PM -0600, David Segonds wrote: > I am sure they will. The question is how I can achieve that simply. I > need to research how other packages are dealing with this. Especially > when packages are upgraded.
Typically you ask the appropriate questions, and then in the postinst modify the config files appropriately. Unfortunately that then triggers dpkg's "oh no you fscked with a conffile" mode, unless the file isn't handled by dpkg at all (in which case you are responsible for cleaning it up in your postrm's purge). > One way would be to heavily modify the upstream configuration file > while maintaining compatibility so that upgrades and reconfiguration > works as specified in debian-policy. 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. 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. To cover that circumstance, I've started to make a file containing an md5sum of the config file, and before I change it I make sure the user hasn't. If they've changed it at all (so the md5sum has changed), I don't make any modifications and it's then the user's problem to keep it up to date. It's by no means perfect, but it follows Policy's "must keep local config changes", and doesn't require pre- and post-knowledge of what the options were in Debconf. > 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. - Matt -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]