Browse Source

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

fixes #1
master
Vitold S Stefan Bodewig 10 years ago
parent
commit
123266127c
4 changed files with 17 additions and 2 deletions
  1. +1
    -0
      CONTRIBUTORS
  2. +4
    -0
      WHATSNEW
  3. +4
    -0
      contributors.xml
  4. +8
    -2
      src/script/runant.py

+ 1
- 0
CONTRIBUTORS View File

@@ -389,6 +389,7 @@ Valentino Miazzo
Victor Toni
Vimil Saju
Vincent Legoll
Vitold S
Volker Leidl
Waldek Herka
Wang Weijun


+ 4
- 0
WHATSNEW View File

@@ -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:
--------------



+ 4
- 0
contributors.xml View File

@@ -1564,6 +1564,10 @@
<first>Vimil</first>
<last>Saju</last>
</name>
<name>
<first>Vitold</first>
<last>S</last>
</name>
<name>
<first>Volker</first>
<last>Leidl</last>


+ 8
- 2
src/script/runant.py View File

@@ -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:], ' '))


Loading…
Cancel
Save