I'm working on packaging the remote microscope software using Distutils, because it'll make my life easier and be a good test case for installing an application. One issue that's just come up is configuration files and upgrading. If someone installed a previous version of the software, you don't want to just blow away their painstakingly customized configuration. Strawman proposal: do this the way RPM does it, marking configuration files as special and making a backup copy. You can list config filenames in the RPM spec file, and on installation the existing version of the file is copied to <name>.rpmsave before the new version of the file is written. The distutils version of this would be: * Add another argument to setup(): config_files = ['spam.cfg', ...] * Add build_config and install_config commands. install_config checks before overwriting an existing config file, and renames the file by adding .backup (suggestions for the extension?). Because of its installation database, RPM can check if the file hasn't been modified from the originally installed version and doesn't bother backing it up if you haven't changed the file. That doesn't seem possible for Distutils, since there's no such database, so it'll just back up all the config files. What do you all think of the idea? -- A.M. Kuchling http://starship.python.net/crew/amk/ "Python? Oh, I've heard of that. I have a friend at the NSA who uses it." -- Overhead at a meeting, quoted in c.l.p on 3 Dec 1998
On Fri, May 26, 2000 at 11:42:21AM -0400, Andrew M. Kuchling wrote:
Because of its installation database, RPM can check if the file hasn't been modified from the originally installed version and doesn't bother backing it up if you haven't changed the file. That doesn't seem possible for Distutils, since there's no such database, so it'll just back up all the config files.
Greg suggested to me the idea of storing meta-data as part of the installation process (for later use by an uninstall command), it seems to me that this could also be used for managing config files. Unfortunately I haven't got a chance to look into it yet, but I will Real Soon Now. -- Harry Henry Gebel, Senior Developer, Landon House SBS West Dover Hundred, Delaware PyNcurses ncurses binding for Python http://pyncurses.sourceforge.net
On 26 May 2000, Andrew M. Kuchling said:
The distutils version of this would be:
* Add another argument to setup(): config_files = ['spam.cfg', ...]
Yup.
* Add build_config and install_config commands. install_config checks before overwriting an existing config file, and renames the file by adding .backup (suggestions for the extension?).
Shouldn't be necessary -- could just complicate "install_data" to deal with config files as a special case. BTW there is no "build_data" command, nor does there need to be. (I think... I hope!) Greg -- Greg Ward - nerd gward@python.net http://starship.python.net/~gward/ I'd like some JUNK FOOD ... and then I want to be ALONE --
participants (3)
-
Andrew M. Kuchling
-
Greg Ward
-
Harry Henry Gebel