delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/09/24/18:11:56

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 24 Sep 2004 18:11:28 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
Subject: Re: Is setup.exe _supposed_ to delete the cygwin dll before attempting to run shell scripts?
In-Reply-To: <41549A76.221A8526@dessent.net>
Message-ID: <Pine.GSO.4.61.0409241804170.20381@slinky.cs.nyu.edu>
References: <NUTMEG1Ed28kIN4MmXK000000d1 AT NUTMEG DOT CAM DOT ARTIMI DOT COM> <NUTMEGljWwY0VnkB4lt000000d7 AT NUTMEG DOT CAM DOT ARTIMI DOT COM> <20040924164839 DOT GJ674 AT trixie DOT casa DOT cgf DOT cx> <20040924170321 DOT GL12802 AT cygbert DOT vinschen DOT de> <Pine DOT GSO DOT 4 DOT 61 DOT 0409241356130 DOT 880 AT slinky DOT cs DOT nyu DOT edu> <011d01c4a266$19792470$78d96f83 AT robinson DOT cam DOT ac DOT uk> <Pine DOT GSO DOT 4 DOT 61 DOT 0409241526430 DOT 20381 AT slinky DOT cs DOT nyu DOT edu> <41549A76 DOT 221A8526 AT dessent DOT net>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.39

On Fri, 24 Sep 2004, Brian Dessent wrote:

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

<PEDANTIC>
Properly speaking, the depth-first order will be B, D, C, A...
</PEDANTIC>

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

Unfortunately, this won't work when you have circular dependencies (e.g.,
cygwin <-> fileutils).  Furthermore, preremove dependencies can't always
be determined from package dependencies (see cygwin-apps archives if
interested).

I think Max's solution is probably the least complex short-term one (i.e.,
run all preremove scripts in batch *before* removing any files, and hope
for the best).

> 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.)

FWIW, it shouldn't matter whether the postinstall scripts are run after
each package's files are installed or at the end, as long as they're run
in dependency order.  This *is* the way it's supposed to happen in the
current method, but there's a bug in the script running code somewhere,
and scripts don't get run when packages are traversed, so they're picked
up and run afterwards.

Say it with me: <http://cygwin.com/acronyms/#PTC>... 0:)
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019