This is the mail archive of the cygwin-apps@cygwin.com 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: Heads-up: postinstall scripts and PATH (Attn all package maintainers)


On Tue, 24 Feb 2004, Christopher Faylor wrote:

> On Tue, Feb 24, 2004 at 03:00:11PM -0500, Igor Pechtchanski wrote:
> >Someone was installing Cygwin from scratch on a clean system, and they
> >had a problem running the postinstall scripts.  On further
> >investigation, it turned out that most of the scripts assume "/bin" is
> >going to be in the PATH, and that it's going to precede any other
> >directories (even the script that's supposed to create /etc/profile!).
> >
> >IMO, postinstall scripts should assume that PATH is *unset*, and all
> >executables should be explicitly specified.
>
> Wow.  I can't believe I fell into this trap.  I have been writing shell
> scripts for a long long time and should know better.
>
> Thanks for the heads up.  I suspect that this accounts for some strange
> installation problems.
>
> Would it be worthwhile to just have setup.exe put /bin first in the path
> when running these things?  I know that the absolutely correct solution
> is to use absolute path names in these scripts but people are going
> to forget, so...
>
> cgf

This might work, except that a) postinstall scripts on the whole are
updated more often and more easily than setup.exe (i.e., this solution
won't help people using the version of setup.exe they already have on
their computer, so the scripts will still have to be fixed), and b) this
won't affect dependence problems and scripts using bash syntax with
/bin/sh.  Besides, if setup.exe sets the path, it will encourage keeping
this bug, rather than fixing it.

A better thing for setup to do would be to "unset PATH" before running the
scripts, and wait for the errors to pour in. ]:->

Oh, and this would probably be a good thing to add to the checklist for
package reviews: that the postinstall script has full paths everywhere and
that the packages containing all the executables it needs are in the
"requires:" clause of setup.hint.
	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!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


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