cygpath hangs from postinstall scripts when called like $(cygpath -S) but not otherwise

Harold L Hunt II huntharo@msu.edu
Thu Oct 2 22:26:00 GMT 2003


This looks like a cygpath problem, but it has something to do with the 
environment in which cygpath gets run from a postinstall script. 
Whomever is interested, please look into it.  Whomever is not 
interested, please keep your grumpy flames to yourself.


To demonstrate this problem, please do the following
====================================================

1) Save the attached file as /etc/postinstall/cygpath-hangs.sh.

2) Run setup.exe, select any mirror.

3) Choose 'keep' on the package selection page.  Then, select a null 
package (e.g. XFree86-base) and choose 'reinstall'.  This will cause 
postinstall scripts to be run, but it won't change your installed 
package or force you to have to download a large package just to get 
this behavior.

4) setup.exe will run cygpath-hangs.sh and, lo!, it will sit there (i.e. 
hang) waiting for cygpath-hangs.sh to return.

5) Go look in /var/log/ for the most recent file following the pattern 
setup.log.postinstall*.  Open it.

6) You should see the following in the log file:

+ which which
/usr/bin/which
+ cygpath -S
/cygdrive/c/WINDOWS/system32
++ which which
+ FOO=/usr/bin/which
++ cygpath -S

7) Run /etc/postinstall/cygpath-hangs.sh from a bash shell and observe 
that it does not hang.


Summary
=======

1) You can run 'which which' from a postinstall script without saving 
its output to a variable.

2) You can run 'cygpath -S' (or any other flag combo) from a postinstall 
script without saving its output to a variable.

3) You can run 'which which' from a postinstall script and save its 
output to a variable (e.g. FOO=$(which which))

4) If you run 'cygpath -S' from a postinstall script and save its output 
to a variable (e.g. BAR=$(cygpath -S)), then cygpath will fail to return 
for eternity.

5) cygpath's failure to return causes bash to fail to return, which 
causes setup.exe to wait forever for cygpath-hangs.sh to complete.


There, I have proven beyond a doubt that this has absolutely nothing to 
do with Cygwin/XFree86 :)

I would appreciate any help in fixing this.

Thanks in advance,

Harold
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygpath-hangs.sh
URL: <http://cygwin.com/pipermail/cygwin-xfree/attachments/20031002/f3765bcc/attachment.ksh>


More information about the Cygwin-xfree mailing list