This is the mail archive of the
mailing list for the Cygwin project.
Re: cygport: patches welcome?
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-apps at cygwin dot com
- Date: Fri, 13 Jul 2007 10:06:32 +0200
- Subject: Re: cygport: patches welcome?
- References: <email@example.com> <4696F3CE.firstname.lastname@example.org>
- Reply-to: cygwin-apps at cygwin dot com
[Grr, I forgot to redirect this Mail. This should have gone
to the cygwin-apps list, actually]
On Jul 12 21:38, Eric Blake wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> According to Andrew Schulman on 7/12/2007 12:26 PM:
> > (2) Smarter update of config files. In cygport's make_etc_defaults
> > function, we have a golden opportunity to fix a problem that's persisted for
> > a long time in Cygwin: when a package's default config file (typically in
> > /etc) is updated, we don't currently have a standard way of automatically
> > and safely installing the new version, because just copying it into /etc
> > would destroy any of the user's existing customizations. Our current best
> > practice is to put
> > [ -f /etc/file ] || cp /etc/defaults/etc/file /etc
> But when coupled with preremove scripts, this is the right approach.
> Provided, of course, that the pre-remove does:
> cmp -s /etc/file /etc/defaults/etc/file && rm /etc/file
> or similar, which removes the file only if it is unmodified, so that the
> followon postinstall will only install the file if the user never touched
> it prior to the upgrade.
I'm still not sure how to handle situations where the default config
file in /etc/defaults/etc has changed between releases, but the user has
also changed the copied config file in /etc. We have no mechanism and
no standarized way to handle this so far.
It looks like the postinstall script would have to create a copy of the
file within /etc/defaults/etc first. This allows the postinstall script
in subsequent releases to recognize the fact that the config file has
We could create a similar naming convention as rpm (.cygnew, .cygorig)
and then we just need a way that setup notifies the user.
Two ideas come to mind.
- A postinstall script which has created a backup file returns a
standarized return code (42 for instance). Setup uses this return
code to create a "backup files have been created by the following
- We only allow this mechanism for the /etc directory. After the
postinstall scripts have finished, setup searches /etc and creates
a list of backup files which it presents to the user.
Does that sound ok? Any other ideas?
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html