John Morrison wrote: > Hi All, > > Christopher and I had a little conversation at the beginning of > December. It occured to me/us that a lot of cygwin packages > have postinstall scripts which just copy default versions of > configuration files into the correct location if they don't > already exist. > > It was thought that this could be simplified into just one > postinstallation script. Basically, the script would, when a > new file has been placed under a particular directory > (/etc/defaults/) it would be copied (/etc/defaults/ becomming > the equivalent of /) if a file of the same name didn't already > exist. > > This has (I think) two advantages > 1) not everyone has to maintain such a post installation script and > 2) there's no excuse not to make use of it and config files > wouldn't be deleted upon uninstall.
I think that in-package postinstall scripts are better: mainly because incver_ifdep only causes the action to happen when a package is put on the mirrors, not when the package is installed. Suppose: update-defaults is in Base, so I have it installed. When it incver_ifdeps, it gets re-run. Later, I decide to install another package. Its config files don't get copied from /etc/defaults. That's not to say I don't think /etc/defaults itself is a good idea. I'd rather see a situation where packages installed files to /etc/defaults, and there was a boilerplate postinstall script that packages could incorporate. Actually, this method might be better for update-info-dir as well. Note that packages can have more than one postinstall script. All that needs to happen is for the package build script to put the postinstall script in place in the binary package. Since there is a boilerplate package building script now in CVS, it could even incorporate the postinstall scripts in here documents. Then, if we want to be really clever, the build script can list /usr/info and /etc/defaults within the binary package being prepared, and create the appropriate postinstalls. Comments? Max.