Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 49914 invoked from network); 18 Sep 2006 14:18:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Sep 2006 14:18:29 -0000 Received: (qmail 60826 invoked by uid 500); 18 Sep 2006 14:18:28 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 60795 invoked by uid 500); 18 Sep 2006 14:18:27 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 60784 invoked by uid 99); 18 Sep 2006 14:18:27 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Sep 2006 07:18:27 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of peter.kitt.reilly@gmail.com designates 64.233.182.185 as permitted sender) Received: from [64.233.182.185] (HELO nf-out-0910.google.com) (64.233.182.185) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Sep 2006 07:18:18 -0700 Received: by nf-out-0910.google.com with SMTP id x29so2612528nfb for ; Mon, 18 Sep 2006 07:17:14 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=JDG010UmLaNYpKl55bgkxI+BistHX2Mdys17tNhC1ZWB2NpD79HkBr5kAvDkxCupXsgo/MxBO5ey+YaR/H9y0chdrmiQjKkZzkuuCl1OJYNkeJBpm8GIBnqLUZn4Z5Hw/V5yBAkDmufUczBJC1ufz/bNlpCSMJVl9I1oXRU2aiE= Received: by 10.49.20.5 with SMTP id x5mr16979042nfi; Mon, 18 Sep 2006 07:17:12 -0700 (PDT) Received: by 10.49.90.10 with HTTP; Mon, 18 Sep 2006 07:17:11 -0700 (PDT) Message-ID: Date: Mon, 18 Sep 2006 15:17:12 +0100 From: "Peter Reilly" To: "Ant Developers List" Subject: Re: svn commit: r446979 - in /ant/core/trunk: CONTRIBUTORS WHATSNEW contributors.xml src/main/org/apache/tools/ant/taskdefs/Execute.java In-Reply-To: <255d8d690609180624xc28e2d3kda678986142d6c08@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_360665_26984779.1158589032008" References: <20060916234831.B4E841A981C@eris.apache.org> <255d8d690609180624xc28e2d3kda678986142d6c08@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_360665_26984779.1158589032008 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi DD, Thanks for the comments, it is always nice for people to check the code - I mentioned that this patch was the one that I was a little worried about. 1) The code does not export the lower case version of the env variable that the user passed in, the lower case version is only used for comparision purposes. 2) Windows in case-insensitive as regards env names, however before this patch, it was very easy to have multiple env settings corresponding to the same name placed in the env list passed to the subprocess. I have done some testing with this change, for example: Path is ${ env.PATH} echo %PATH% ls The one thing that is infurating is that "Path" can be "PATH" or "path" or whatever is the whim of the windows machine, and it is difficult to write an ant script that work correctly when using , perhaps we could provide a touppercase=yes/no option to , or provide a "${getenv:} prefix to ${} expansion to correspond to java(1.1-, 5+) System.getenv(key). Note that getenv() is case-insensitive: Please try out the case-insensentive version of One change that could be made would be to ignore the casiness of the key in the and use the casiness of the key in the current env, it is present. Peter On 9/18/06, Dominique Devienne wrote: > > On 9/16/06, peterreilly@apache.org wrote: > > bugzilla 28874: make env case insensitive for windows > > @@ -624,9 +627,17 @@ > > for (int i = 0; i < env.length; i++) { > > // Get key including "=" > > String key = env[i].substring(0, env[i].indexOf('=') + 1); > > + if (environmentCaseInSensitive) { > > + // Nb: using default locale as key is a env name > > + key = key.toLowerCase(); > > + } > > int size = osEnv.size(); > > for (int j = 0; j < size; j++) { > > - if (((String) osEnv.elementAt(j)).startsWith(key)) { > > + String osEnvItem = (String) osEnv.elementAt(j); > > + if (environmentCaseInSensitive) { > > + osEnvItem = osEnvItem.toLowerCase(); > > + } > > + if (osEnvItem.startsWith(key)) { > > osEnv.removeElementAt(j); > > break; > > } > > Peter, can you please explain this patch a bit? I've also been bitten > by the case of (PATH | Path | path) on Windows in the past, but solved > it by assigning the Path's current env key and value to 2 properties, > to ensure I was using the same case when assigning it for a > sub-process. > > This is different than forcing env keys to be lower-case > (case-insensitive), and that worries me a bit franckly... In my > experience, the path *must* be assigned using the same case used by > the Ant process, and going to all lower-case doesn't do that. This is > critical when forking any process (, , ) that > depends on Path (or PATH, or path) to be set properly to run. > > Thanks for any insight on this. Right-now I worried about this. --DD > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org > > ------=_Part_360665_26984779.1158589032008--