> > | -Install() only creates /etc/bogofilter.cf once, but if the user does not > | touch this file, then when they upgrade bogofilter, they should get the > | latest and greated bogofilter.cf instead of being stuck with the one from > | their first download. > > This is a problem that I have no solution. Can you share your thoughts > how this could be done intelligently? The problem I see is: > > If /etc/xxx.conf is already there, there is no way knowing if this > has remained the same or if user has made changes to it. The new > > Cygwin does not have conflict resolution of /etc/ file like seen in Debian, > so it is more safer to just let user to check under /usr/share/doc/<package> > for new features.
This really ought to be documented better on the packaging instructions page. The trick is to use a preremove script (see how base-files does it, for example). A file named /etc/preremove/bogofilter.sh will be called just before the package is uninstalled (setup.exe uninstalls the old version before installing the upgraded version), so in that script, if /etc/xxx.conf exists and is identical to /usr/share/doc/xxx.template, just delete it. But if it differs at all, leave it alone. Also, it is a good idea to have a file /etc/preremove/bogofilter-manifest.lst, which lists every file that was created by the postinstall script, and which will be removed on preremove if untouched by the user. Someday, 'cygcheck -c' might parse the manifest lists to help diagnose if postinstalls have not completed. > > I've rolled up new archive. I'll let you get the preremove script in first, before checking out the new package. Thanks for putting up with my nit-picking :) -- Eric Blake