Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <41549A76.221A8526@dessent.net>
Date: Fri, 24 Sep 2004 15:06:46 -0700
From: Brian Dessent <brian@dessent.net>
Organization: My own little world...
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Is setup.exe _supposed_ to delete the cygwin dll before attempting to run shell scripts?
References: <NUTMEG1Ed28kIN4MmXK000000d1@NUTMEG.CAM.ARTIMI.COM> <NUTMEGljWwY0VnkB4lt000000d7@NUTMEG.CAM.ARTIMI.COM> <20040924164839.GJ674@trixie.casa.cgf.cx> <20040924170321.GL12802@cygbert.vinschen.de> <Pine.GSO.4.61.0409241356130.880@slinky.cs.nyu.edu> <011d01c4a266$19792470$78d96f83@robinson.cam.ac.uk> <Pine.GSO.4.61.0409241526430.20381@slinky.cs.nyu.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Reply-To: cygwin@cygwin.com

Igor Pechtchanski wrote:

> It'll work for simple programs, but not for packages where preremove
> scripts erase files that are needed to run some programs from that
> package.  One example (not necessarily a perfect one) that comes to mind
> right away is the base-files package, where the preremove script will
> currently erase /etc/profile (so any script executing "bash -l" will not
> get the expected results).  I'm sure there are better examples...
> 
> FWIW, this is probably somewhat similar to the issue of circular
> dependencies of postinstall scripts -- there is no good general solution
> if we assume monolithic scripts.

Wouldn't the "proper" way to do this be to build the dependency tree
then remove packages in depth-first order, running each preremove before
removing each package list?

Example:

Dependency tree:

  A
 / \
B   C
     \
      D

So lets say you want to remove and then upgrade new versions of A, B, C,
and D.

You first get the depth-first order: D, C, B, A.

Then you run: preremove(D), remove-files(D), preremove(C),
remove-files(C), preremove(B), remove-files(B), preremove(A),
remove-files(A)

To install you do the same thing, except you'd do breadth-first and
you'd do postinstall(X) after each install-files(X).  (I know this is
not the current method, where all postinstalls are run in a batch at the
end.)

Brian

--
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/

