forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Re: forrestbot FORREST_HOME problem
Date Thu, 28 Nov 2002 09:50:44 GMT
On Thu, 2002-11-28 at 07:00, Jeff Turner wrote:
> On Wed, Nov 27, 2002 at 06:24:49PM +0100, Bruno Dumon wrote:
> > Hi,
> > 
> > I'm trying to use the forrestbot (and have it running now), but I
> > stumbled upon the following problem.
> > 
> > The forrestbot script (from the generated shbat/bin directory) sets the
> > FORREST_HOME to `dirname "$0"`/.. , which in my case results in ./..
> > (I'm starting the forrestbot script from the shbat/bin directory, using
> > bash shell in Linux).
> 
> Same here.
>  
> > The fact that this is a relative path causes trouble further on in the
> > bot process (more specifically when using the "local-copy" type of
> > get-src, because it will then execute the forrest.build.xml from another
> > working directory).
> 
> What problems does it cause?
> 
> template.get-src.local-copy has:
> 
>     <ant dir="${get-src.local-copy.project-dir}"
>       antfile="${forrest.home}/forrest.build.xml" target="project-context-bot">
>     </ant>
> 
> Running the samples/forrest-template-local.xml script, that expands for me to:
> 
> <ant dir="../../fresh-site"
>       antfile="/home/jeff/apache/xml/xml-forrest/build/dist/shbat/bin/../forrest.build.xml"
target="project-context-bot">
>     </ant>
> 

Since my FORREST_HOME evaluates to "./..", the antfile attribute expands
in my case to antfile="./../forrest.build.xml".

But now I see why it evaluates to "./..": it is because the
$FORREST_HOME/bin directory is not in my PATH. And if it is in the PATH,
and the working directory is $FORREST_HOME/bin, I still need to be
carefull that the $FORREST_HOME/bin is before "." in the PATH, otherwise
it will also give "./..".

So to summerize: Adding $FORREST_HOME/bin to the PATH before the
occurence of "." is a requirement.

So the installation notice that now says:

  | It is recommended to add
  |    unix: $FORREST_HOME/bin: to your $PATH

isn't entirely correct (since it's not recommended but required to add
...)

Anyhow, does anybody know a trick that will always return the full path
of the script, regardless of the location from where it's executed and
wheter it is in the PATH or not?

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org


Mime
View raw message