cygport: patches welcome?

Corinna Vinschen
Fri Jul 13 08:00:00 GMT 2007

On Jul 12 21:38, Eric Blake wrote:
> 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
  packages" list.

- 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
Red Hat

Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list