Bug 11511 - Ant script on Cygwin sets ANT_LIB before fixing ANT_HOME
Summary: Ant script on Cygwin sets ANT_LIB before fixing ANT_HOME
Status: RESOLVED DUPLICATE of bug 10664
Alias: None
Product: Ant
Classification: Unclassified
Component: Wrapper scripts (show other bugs)
Version: 1.5
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-06 19:43 UTC by David M. Karr
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David M. Karr 2002-08-06 19:43:24 UTC
In version 1.5, the "ant" script will generate an invalid classpath, as it
computes the value of "ANT_LIB" before it converts ANT_HOME to a Unix-based
path.  When the value of ANT_LIB is later used to form the classpath, it will
still have a DOS-based path, which will corrupt the CLASSPATH value.

The fix is easy, just to move the setting of "ANT_LIB" after the block where it
converts ANT_HOME to a Unix path.  Following this is a diff showing this change.

*** /c/jakarta/ant/bin/ant~	Tue Aug  6 11:31:35 2002
--- /c/jakarta/ant/bin/ant	Tue Aug  6 12:35:21 2002
***************
*** 69,77 ****
    cd $saveddir
  fi
  
- # set ANT_LIB location
- ANT_LIB=${ANT_HOME}/lib
- 
  # For Cygwin, ensure paths are in UNIX format before anything is touched
  if $cygwin ; then
    [ -n "$ANT_HOME" ] &&
--- 69,74 ----
***************
*** 82,87 ****
--- 79,87 ----
      CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
  fi
  
+ # set ANT_LIB location
+ ANT_LIB=${ANT_HOME}/lib
+ 
  if [ -z "$JAVACMD" ] ; then 
    if [ -n "$JAVA_HOME"  ] ; then
      if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Comment 1 Stefan Bodewig 2002-08-09 07:28:40 UTC
<http://jakarta.apache.org/ant/faq.html#1.5-cygwin-sh>

*** This bug has been marked as a duplicate of 10664 ***