This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] setup: Detect postinstall scripts correctly


On Wed, 28 Sep 2005, Eric Blake wrote:

> According to Igor Pechtchanski on 9/27/2005 10:19 AM:
>
> > As I understand, there are now some postinstall scripts that rely on
> > the current (buggy) behavior.  However, this is the only way to
> > enforce a deterministic order on the postinstall script execution in
> > the presence of circular dependencies.  Before we apply this patch, we
> > ought to make sure that the current postinstall script structure
> > doesn't break.  It didn't seem to break for me -- I've tested it on a
> > relatively large fresh install, but, as we all know, "one sample does
> > not a statistic make"(tm). I'd be more comfortable with, say, Eric
> > signing off on this with respect to the ash/bash postinstall scripts.
>
> Both ash and bash install their postinstalls named with a leading 00,
> putting them first alphanumerically in the 'other' group.  But if
> dependency order is enforced, then any other package with a /bin/sh
> postinstall should make sure that they depend on bash, to guarantee that
> bash's postinstall will be run first (needed so that a /bin/sh exists to
> run the package's script).

Any package with a postinstall shell script ought to depend on bash
anyway, since it can't be completely installed without it (speaking of
which, we don't detect postinstall dependencies in the g-b-s).

I'm only worried about circular dependencies -- what does bash depend on?

Actually, AFAICS, bash doesn't need the postinstall script to work
correctly -- the sole purpose of the script is to make sure /bin/sh
exists...  Perhaps the bash/ash combo wasn't the right example for the
kinds of problems I expected...

> The only problem that I can think of is if the user had a failed
> install, so that /bin/sh doesn't exist and 00bash.sh has not been
> renamed 00bash.sh.done; then on their next use of setup.exe they select
> a package with a postinstall.  If I understood your explanation, that
> package postinstall will attempt to run before 00bash.sh, and fail
> because /bin/sh still doesn't exist.

Correct.

> But considering the user already had a failed installation, we can just
> remind them to reinstall bash at the same time (and these days, there
> haven't been as many complaints of missing /bin/sh).

Exactly.  I'm less worried about those cases.

> Or maybe we can improve the dependency logic - sort all newly installed
> packages by dependency, but also check all dependencies on previously
> installed packages to see if the previous postinstall scripts haven't run,
> and if so, insert them in the proper dependency order rather than
> collecting them into the 'other' group.

Ugh.  I'd rather have a general fix for the "previous setup run didn't
complete" situation.  That way, all uncompleted postinstall scripts will
run *first*, before any packages are installed.  Those are easy enough to
detect, BTW -- any script that's not ".done" at the time setup runs...
Opinions?

> That would leave the 'other' group containing only those postinstall
> scripts not needed as dependencies of the sorted group.

Technically, there shouldn't be *any* scripts in the "other" group ATM --
the only ones that wouldn't be in the package listings are those that are
generated by other postinstall scripts (and we could have a separate
mechanism for detecting those) or scripts that will perform administrative
functions "on next install" (the latter category will break my above
assumption, BTW).

> I'm game for making the fix.

Good.  Now it's up to Brian to give me the go-ahead to apply the patch (or
apply it himself).

> We may want to post an alpha version of
> setup.exe to play with for a few days before announcing it to the list,
> however.

Here you go: <http://cs.nyu.edu/~pechtcha/cygwin/setup-2.513-alpha.exe>.
It contains all three of the recent patches I submitted.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]