Bug#383149: [Pkg-octave-devel] Bug#383149: Found the cause.

Rafael Laboissiere rafael at debian.org
Thu Aug 17 15:24:58 UTC 2006


* John Dalton <john.dalton at bigfoot.com> [2006-08-17 21:53]:

> I've got a program called OpenFOAM installed.  It's
> a bit of a yukky program in that it sets some environment
> variables in ~/.bashrc.  Consequently the environment of my
> login shell looks like:
> 
> {lots of stuff deleted}
> CXXFLAGS=-m32
> CXX=g++
> 
> When mkoctfile evaluates CXXFLAGS and CXX, it sees the values
> from my shell environment, not the values being set within
> mkoctfile (CXX="/usr/bin/g++" and CXXFLAGS="-O2")
> 
> That explains the weird appearance of g++ and -m32.

I am glad you found the cause of the problem.

> Is it correct that existing values in the shell environment should 
> override the default values within mkoctfile?

Yes, this is the intended behavior.  Otherwise, how could the user change
the mkoctfile default?  This is what environment variables are for.

> Is there a reason mkoctfile reads
> : ${LD_CXX="/usr/bin/g++"}
> instead of
> LD_CXX="/usr/bin/g++"
> 
> I don't really understand what
> : ${variable="value"}
> is doing.  Can someone please explain it to me?

The colon (:) is a shell built-in command.  From the bash man page:

    : [arguments] 
        No  effect;  the command does nothing beyond expanding arguments
        and performing any specified redirections.  A zero exit code  is
        returned.

I think that the colon in the command above is superfluous.  The colon is
good for avoiding output and error messages.  Try this:

    touch foo
    ls foo
    : ls foo
    rm foo
    ls foo
    : ls foo

> I guess one solution is for me to remove the variables from my
> environment, [...]

Yes, this is the right thing to do.  You might tell the OpenFOAM
developers to not alter ~/.bashrc in a so pernicious way.  This is
plain wrong.

-- 
Rafael




More information about the Pkg-octave-devel mailing list