X-Spam-Check-By: sourceware.org Date: Fri, 13 Jul 2007 10:00:48 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: cygport: patches welcome? Message-ID: <20070713080048.GK6851@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <4696F3CE DOT 9060304 AT byu DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4696F3CE.9060304@byu.net> User-Agent: Mutt/1.4.2.2i Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 changed. 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 -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/