Return-Path: X-Original-To: apmail-ant-notifications-archive@minotaur.apache.org Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC67BC8D5 for ; Tue, 18 Nov 2014 16:04:20 +0000 (UTC) Received: (qmail 47850 invoked by uid 500); 18 Nov 2014 16:04:20 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 47810 invoked by uid 500); 18 Nov 2014 16:04:20 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 47801 invoked by uid 99); 18 Nov 2014 16:04:20 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Nov 2014 16:04:20 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 78BEC99FEF7; Tue, 18 Nov 2014 16:04:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bodewig@apache.org To: notifications@ant.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) 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 Authored: Tue Nov 18 17:02:55 2014 +0100 Committer: Stefan Bodewig 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 @@ Saju + Vitold + S + + Volker Leidl 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:], ' '))