http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1479

*** shadow/1479 Tue Apr 24 08:59:19 2001
--- shadow/1479.tmp.16262       Tue Apr 24 08:59:19 2001
***************
*** 0 ****
--- 1,63 ----
+ +============================================================================+
+ | "ant" script CygWin support broken: colons vs. semicolons in paths         |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 1479                        Product: Ant                     |
+ |       Status: NEW                         Version: 1.3                     |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Normal                   OS/Version:                         |
+ |     Priority:                           Component: Wrapper scripts         |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: [EMAIL PROTECTED]                                   |
+ |  Reported By: [EMAIL PROTECTED]                              |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ The "ant" script, although it seems to intend to support CygWin, doesn't
+ correctly support Windows pathnames (with colons) in search paths 
+ (LOCALCLASSPATH).  
+ 
+ Specifically, the script doesn't fully convert file pathnames from 
+ Windows-style (with colons) to Unix-style (without colons) before assembling 
+ a Unix-style (colon-separated) search path from those file pathnames.
+ 
+ I end up with a LOCALCLASSPATH like this:
+ 
+    
+ 
:c:/tools/ant-1.3/bin/../lib/ant.jar:c:/tools/ant-1.3/bin/../lib/jaxp.jar:c:/too
+ ls/ant-1.3/bin/../lib/parser.jar
+ 
+ which, when converted to Windows form, ends up like this:
+ 
+   
+ 
.;c;C:\tools\cygwin\tools\ant-1.3\lib\ant.jar;c;C:\tools\cygwin\tools\ant-1.3\li
+ 
b\jaxp.jar;c;C:\tools\cygwin\tools\ant-1.3\lib\parser.jar;C:\tools\jdk1.3\lib\to
+ ols.jar
+ 
+ 
+ This problem happens if ANT_HOME is derived from the script's $0 argument.
+ 
+ 
+ The problem seems to be that the conversion of environment variable ANT_HOME
+ from Windows-style to Unix-style occurs BEFORE derivation of ANT_HOME from 
+ $0 when ANT_HOME is not already set.  Note the code order:
+ 
+   # For Cygwin, ensure paths are in UNIX format before anything is touched
+   if $cygwin; then
+     [ -n "$ANT_HOME" ] &&
+       ANT_HOME=`cygpath --unix "$ANT_HOME"`
+     ...
+   fi
+ 
+   if [ "$ANT_HOME" = "" ] ; then
+     # try to find ANT
+     ...
+     ## resolve links - $0 may be a link to ant's home
+     PRG=$0
+     ...
+     ANT_HOME=`dirname "$PRG"`/..
+   fi  
+ 
+ Moving the above cygpath calls to after the if  statement labeled "try to 
+ find ANT" seems to fix things.

Reply via email to