bash vs. ash vs. postinstall

Igor Pechtchanski
Thu Jun 23 02:44:00 GMT 2005

On Wed, 22 Jun 2005, Eric Blake wrote:

> According to Corinna Vinschen on 6/22/2005 7:27 AM:
> > What about something along these lines:
> >
> > - ash only provides /bin/ash.exe
> > - bash provides /bin/bash.exe and sh.exe (linked or copied)
> > - ash gets a dependency to bash.
> > - *Both* packages get postinstall #!/bin/bash scripts which copy bin/bash
> >   to /bin/sh.
> >
> > Would that help?
> I agree with the first three points.  But on the fourth one, does
> setup.exe really honor the #!?  (If it doesn't, then initscripts-0.9-1,
> squid-2.4.STABLE7-1, tcp_wrappers-7.6-1, and xinetd-2.3.9-1 currently have
> problems, because their postinstalls try to use #!/bin/bash.)

Setup runs postinstall scripts via "$SHELL -c $SCRIPT", which honors the
shebang.  The good news is that setup tries a few shells in order
(/bin/sh, /usr/bin/sh, /bin/bash, and /usr/bin/bash), so if /bin/sh is
missing, /bin/bash will be used.  The bad news is that "bash -c script"
will honor the shebang in the script, so if it has #!/bin/sh, bash will
attempt to execute /bin/sh (and fail with "bad interpreter" if it's

> All says is that a is run
> with the cygwin shell (so that should be cleaned up to be more exact).

See above.

> I don't think it would be too hard to provide a .bat that does the copy,
> though.

True, and it would be independent of whether /bin/sh is present.

> Also, I can see the value of ash having a postinstall script to copy
> bash to /bin/sh, but if bash is already providing /bin/sh in its
> package, does it really need the postinstall as well?

One other thing is that postinstall scripts are run in alphabetical order,
so naming the script should make it execute first.
      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

More information about the Cygwin-apps mailing list