You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2006/10/10 23:45:46 UTC

svn commit: r462590 - in /ant/core/trunk: docs/manual/install.html src/script/ant

Author: peterreilly
Date: Tue Oct 10 14:45:45 2006
New Revision: 462590

URL: http://svn.apache.org/viewvc?view=rev&rev=462590
Log:
1) modify ant script to *NOT* . include /etc/ant.conf
   if ANT_HOME variable is set.
2) apply jpackage patch to ant script
3) modify manual to include the change in behaviour to ANT_HOME and jpackage


Modified:
    ant/core/trunk/docs/manual/install.html
    ant/core/trunk/src/script/ant

Modified: ant/core/trunk/docs/manual/install.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/install.html?view=diff&rev=462590&r1=462589&r2=462590
==============================================================================
--- ant/core/trunk/docs/manual/install.html (original)
+++ ant/core/trunk/docs/manual/install.html Tue Oct 10 14:45:45 2006
@@ -227,33 +227,6 @@
   </td>
 </tr>
 </table>
-<table width="80%">
-<tr>
-  <td colspan="2">
-    <b>Linux Note:</b>
-  </td>
-</tr>
-<tr>
-  <td width="5%">&nbsp;</td>
-  <td>
-    A jpackage rpm version of ant may be installed on your machine,
-    say as part of install of Fedora Core 3. If another version
-    of ant is installed, the rpm version <b><u>will</u></b> take
-    priority. This is due to the fact that ant bash script file
-    dot includes the /etc/ant.conf file from the jpackage distribution.
-    The current version of this file (sept 2006) overwrites the
-    ANT_HOME environment variable. If this happens, ant will
-    issue a warning. To fix this, modify the line in /etc/ant.conf
-    <br/>
-    <code>ANT_HOME=/usr/share/ant</code>
-    <br/>
-    to be
-    <br/>
-    <code>ANT_HOME=${ANT_HOME:-/usr/share/ant}</code>.
-  </td>
-</tr>
-</table>
-
 
 <h3><a name="optionalTasks">Optional Tasks</a></h3>
 <p>Ant supports a number of optional tasks. An optional task is a task which
@@ -420,9 +393,14 @@
 The <a href="http://www.jpackage.org">JPackage project</a> distributes an RPM version of Ant.  
 With this version, it is not necessary to set <code> JAVA_HOME </code>or 
 <code> ANT_HOME </code>environment variables and the RPM installer will correctly
-place the Ant executable on your path.  The <code> ANT_HOME </code>environment variable will
-be ignored, if set, when running the JPackage version of Ant.
-</p><p>
+place the Ant executable on your path.
+</p>
+  <p>
+    <b>NOTE:</b> <em>Since Ant 1.7.0</em>, if the <code>ANT_HOME</code>
+    environment variable is set, the jpackage distribution will be
+    ignored.
+  </p>
+  <p>
 Optional jars for the JPackage version are handled in two ways.  The easiest, and
 best way is to get these external libraries from JPackage if JPackage has them 
 available.  (Note: for each such library, you will have to get both the external 

Modified: ant/core/trunk/src/script/ant
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/script/ant?view=diff&rev=462590&r1=462589&r2=462590
==============================================================================
--- ant/core/trunk/src/script/ant (original)
+++ ant/core/trunk/src/script/ant Tue Oct 10 14:45:45 2006
@@ -44,18 +44,11 @@
   rpm_mode=false
   usejikes=$use_jikes_default
 else
-  orig_ant_home=$ANT_HOME
-  # load system-wide ant configuration
-  if [ -f "/etc/ant.conf" ] ; then
+  # load system-wide ant configuration (ONLY if ANT_HOME has NOT been set)
+  if [ -z "$ANT_HOME" -a -f "/etc/ant.conf" ] ; then
     . /etc/ant.conf
   fi
 
-  # Normally users do not expect that /etc/ant.conf will override ANT_HOME
-  if [ -n "$orig_ant_home" -a "$orig_ant_home" != "$ANT_HOME" ] ; then
-    echo "Warning: ANT_HOME has been overridden by /etc/ant.conf from $orig_ant_home to $ANT_HOME"
-    echo "         Use ant -noconfig if this is not desired."
-  fi
-
   # load user ant configuration
   if [ -f "$HOME/.ant/ant.conf" ] ; then
     . $HOME/.ant/ant.conf
@@ -166,6 +159,27 @@
     if [ -n "$_OPTCLASSPATH" ] ; then 
       LOCALCLASSPATH="$LOCALCLASSPATH:$_OPTCLASSPATH"
     fi
+  fi
+
+  # If no optional jars have been specified then build the default list
+  if [ -z "$OPT_JAR_LIST" ] ; then
+    for file in /etc/ant.d/*; do
+      if [ -f "$file" ]; then
+        case "$file" in
+        *~) ;;
+        *#*) ;;
+        *.rpmsave) ;;
+        *.rpmnew) ;;
+        *)
+          for dep in `cat "$file"`; do
+            case "$OPT_JAR_LIST" in
+            *"$dep"*) ;;
+            *) OPT_JAR_LIST="$OPT_JAR_LIST${OPT_JAR_LIST:+ }$dep"
+            esac
+          done
+        esac
+      fi
+    done
   fi
 
   # Explicitly add javac path to classpath, assume JAVA_HOME set



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org