You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Bert Van Kets <be...@vankets.com> on 2002/11/15 14:07:11 UTC

path space problem

The problem with the Win2K batch file is that parameters are passed through 
from one batch file to another.  If the path in these parameters can be 
replaced with environment variables the problem should be solved.  Due to 
the complexity of the batch calling, I haven't finished the problem solving 
yet, but I can say that we need to change not only the forrest.bat file but 
also other bat files (ant.bat etc.)

One of the problems lies in the fact that the CLASSPATH variable is "built 
up" and that for some strange reason spaces in the path are replaces by 
semi colons in the ant.bat file.  I'm still trying to solve this.

Can someone confirm that I can use environment variables in the CLASSPATH 
(ex. %FORREST_HOME%\lib\endorsed\xml-apis.jar)  if not, how do you define a 
classpath that contains spaces.  Quotes are out of the question.

We are nearing a working version.

Bert


This mail is written in 100% recycled electrons.


Re: path space problem

Posted by Bert Van Kets <be...@vankets.com>.
There's no need for this.
I have reverse engineered the task  I echoed the command to screen and 
tweaked it till it worked.  The solution is to pass the environment 
variables till the last commend (calling Ant).

This works from a path containing a space when Forrest is deployed in a 
path containing a space!:

"C:\jdk1.3.1_02\bin\java.exe" -classpath 
"C:\jdk1.3.1_02\lib\tools.jar;%ANT_HOME%\lib\resolver.jar;%ANT_HOME%\lib\nodeps.jar;%ANT_HOME%\lib\ant.jar;%ANT_HOME%\lib\ant-xalan2.jar;%ANT_HOME%\lib\ant-trax.jar;%ANT_HOME%\lib\ant-apache-resolver.jar;;%FORREST_HOME%\lib\endorsed\xalan-2.3.1.jar;%FORREST_HOME%\lib\endorsed\xercesImpl-2.1.0.jar;%FORREST_HOME%\lib\endorsed\xml-apis.jar;%FORREST_HOME%\lib\endorsed\xsltc-20020723.jar" 
-Dant.home="%FORREST_HOME%\ant"  org.apache.tools.ant.Main  -buildfile 
"%FORREST_HOME%\forrest.build.xml" -Dbasedir "%PROJECT_HOME%" 
-Dproject.home "%PROJECT_HOME%" -Dforrest.home "%FORREST_HOME%" -emacs 
-logger org.apache.tools.ant.NoBannerLogger seed

All I need to do now is get to the point that this command is 
generated.  Shouldn't be too hard.
When this is done, we are completely free of the space problem.

The solution actually lies in the buildup of the paths.  Keeping the paths 
inn the environment variables avoids the problem altogether.  This required 
some changes in the FOR loops though (cd to the jar directory and run the 
FOR there to avoid having the full path in the appended parameter).

I got to run now, will finalize this in an hour or two when I'm home.

Bert

At 00:27 16/11/2002 +1100, you wrote:
>On Fri, Nov 15, 2002 at 02:07:11PM +0100, Bert Van Kets wrote:
> > The problem with the Win2K batch file is that parameters are passed
> > through from one batch file to another.  If the path in these
> > parameters can be replaced with environment variables the problem
> > should be solved.  Due to the complexity of the batch calling, I
> > haven't finished the problem solving yet, but I can say that we need to
> > change not only the forrest.bat file but also other bat files (ant.bat
> > etc.)
>
>Are you testing 0.2rc1 or CVS? 0.2rc1 has:
>
>call "%ANT_HOME%\bin\ant" ...
>
>whereas CVS has:
>
>"%ANT_HOME%\bin\ant" ...
>
>It was to make debugging easier, but removing the 'call' could solve any
>problems of passing through parameters.
>
> > One of the problems lies in the fact that the CLASSPATH variable is
> > "built up" and that for some strange reason spaces in the path are
> > replaces by semi colons in the ant.bat file.  I'm still trying to solve
> > this.
>
>Line 21:
>for %%i in ("%FORREST_HOME%\lib\endorsed\*.jar") do call appendcp.bat %%i
>
>I think that expands to:
>
>c:\Program Files\Forrest\... c:\Program Files\Forrest\...
>
>Which gets tokenized into
>
>c:\Program
>Files\Forrest\...
>c:\Program
>Files\Forrest\...
>
>Ie, we would need the individual entries to be quoted:
>
>"c:\Program Files\Forrest\..." "c:\Program Files\Forrest\..."
>
>which I've no idea how to do :/
>
> > Can someone confirm that I can use environment variables in the
> > CLASSPATH (ex. %FORREST_HOME%\lib\endorsed\xml-apis.jar)  if not, how
> > do you define a classpath that contains spaces.  Quotes are out of the
> > question.
> >
> > We are nearing a working version.
>
>We can delay 0.2 if you think you're near a solution..
>
>--Jeff
>
> > Bert


Re: path space problem

Posted by Jeff Turner <je...@apache.org>.
On Fri, Nov 15, 2002 at 02:07:11PM +0100, Bert Van Kets wrote:
> The problem with the Win2K batch file is that parameters are passed
> through from one batch file to another.  If the path in these
> parameters can be replaced with environment variables the problem
> should be solved.  Due to the complexity of the batch calling, I
> haven't finished the problem solving yet, but I can say that we need to
> change not only the forrest.bat file but also other bat files (ant.bat
> etc.)

Are you testing 0.2rc1 or CVS? 0.2rc1 has:

call "%ANT_HOME%\bin\ant" ...

whereas CVS has:

"%ANT_HOME%\bin\ant" ...

It was to make debugging easier, but removing the 'call' could solve any
problems of passing through parameters.

> One of the problems lies in the fact that the CLASSPATH variable is
> "built up" and that for some strange reason spaces in the path are
> replaces by semi colons in the ant.bat file.  I'm still trying to solve
> this.

Line 21:
for %%i in ("%FORREST_HOME%\lib\endorsed\*.jar") do call appendcp.bat %%i

I think that expands to:

c:\Program Files\Forrest\... c:\Program Files\Forrest\...

Which gets tokenized into

c:\Program
Files\Forrest\...
c:\Program
Files\Forrest\...

Ie, we would need the individual entries to be quoted:

"c:\Program Files\Forrest\..." "c:\Program Files\Forrest\..."

which I've no idea how to do :/

> Can someone confirm that I can use environment variables in the
> CLASSPATH (ex. %FORREST_HOME%\lib\endorsed\xml-apis.jar)  if not, how
> do you define a classpath that contains spaces.  Quotes are out of the
> question.
> 
> We are nearing a working version.

We can delay 0.2 if you think you're near a solution..

--Jeff

> Bert