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?