[PATCH] setup: Detect postinstall scripts correctly

Eric Blake ebb9@byu.net
Wed Sep 28 13:08:00 GMT 2005

Hash: SHA1

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

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.  That would leave the 'other'
group containing only those postinstall scripts not needed as dependencies
of the sorted group.

I'm game for making the fix.  We may want to post an alpha version of
setup.exe to play with for a few days before announcing it to the list,

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


More information about the Cygwin-apps mailing list