ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject ant git commit: patch by Vitold S: make runant.py deal with spaces in java's path. fixes #1
Date Tue, 18 Nov 2014 16:04:20 GMT
Repository: ant
Updated Branches:
  refs/heads/master 14b24bcc9 -> 123266127


patch by Vitold S: make runant.py deal with spaces in java's path.
fixes #1


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/12326612
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/12326612
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/12326612

Branch: refs/heads/master
Commit: 123266127cd3c0c41275de1cf41e60efed99ebe3
Parents: 14b24bc
Author: Vitold S <vit1251@gmail.com>
Authored: Tue Nov 18 17:02:55 2014 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Tue Nov 18 17:02:55 2014 +0100

----------------------------------------------------------------------
 CONTRIBUTORS         |  1 +
 WHATSNEW             |  4 ++++
 contributors.xml     |  4 ++++
 src/script/runant.py | 10 ++++++++--
 4 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/12326612/CONTRIBUTORS
----------------------------------------------------------------------
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 21e84fb..4cc8f33 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -389,6 +389,7 @@ Valentino Miazzo
 Victor Toni
 Vimil Saju
 Vincent Legoll
+Vitold S
 Volker Leidl
 Waldek Herka
 Wang Weijun

http://git-wip-us.apache.org/repos/asf/ant/blob/12326612/WHATSNEW
----------------------------------------------------------------------
diff --git a/WHATSNEW b/WHATSNEW
index 8f8d635..4cc9c83 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -45,6 +45,10 @@ Fixed bugs:
    archives that are different at the byte level each time an
    archive was built.
 
+ * runant.py should now work as well when the path of the Java executable
+   contains spaces.
+   github pull request #1
+
 Other changes:
 --------------
 

http://git-wip-us.apache.org/repos/asf/ant/blob/12326612/contributors.xml
----------------------------------------------------------------------
diff --git a/contributors.xml b/contributors.xml
index 4e6e88d..f8d6105 100644
--- a/contributors.xml
+++ b/contributors.xml
@@ -1565,6 +1565,10 @@
     <last>Saju</last>
   </name>
   <name>
+    <first>Vitold</first>
+    <last>S</last>
+  </name>
+  <name>
     <first>Volker</first>
     <last>Leidl</last>
   </name>

http://git-wip-us.apache.org/repos/asf/ant/blob/12326612/src/script/runant.py
----------------------------------------------------------------------
diff --git a/src/script/runant.py b/src/script/runant.py
index 7111766..a0b2764 100644
--- a/src/script/runant.py
+++ b/src/script/runant.py
@@ -51,7 +51,10 @@ if not os.environ.has_key('JAVACMD'):
         if not os.path.exists(os.environ['JAVA_HOME']):
             print "Warning: JAVA_HOME is not defined correctly."
         else:
-            JAVACMD = os.path.join(os.environ['JAVA_HOME'], 'bin', 'java')
+            JAVA_HOME = os.environ['JAVA_HOME']
+            while JAVA_HOME[0] == JAVA_HOME[-1] == "\"":
+                JAVA_HOME = JAVA_HOME[1:-1]
+            JAVACMD = os.path.join(JAVA_HOME, 'bin', 'java')
     else:
         print "Warning: JAVA_HOME not set."
 else:
@@ -85,8 +88,11 @@ CLASSPATH = ""
 if os.environ.has_key('CLASSPATH'):
     CLASSPATH = "-lib " + os.environ['CLASSPATH']
 
+while JAVACMD[0] == JAVACMD[-1] == "\"":
+    JAVACMD = JAVACMD[1:-1]
+
 # Builds the commandline
-cmdline = ('%s %s -classpath %s -Dant.home=%s %s ' + \
+cmdline = ('"%s" %s -classpath %s -Dant.home=%s %s ' + \
     'org.apache.tools.ant.launch.Launcher %s %s %s') \
      % (JAVACMD, ANT_OPTS, LOCALCLASSPATH, ANT_HOME, OPTS, ANT_ARGS, \
         CLASSPATH, string.join(sys.argv[1:], ' '))


Mime
View raw message