[GRASS-dev] GRASS extensions/addons mismatch

Hamish hamish_b at yahoo.com
Tue Dec 20 18:37:47 EST 2011


Michael wrote:
> William has a path set in the Mac startup routine.
> It starts with the desktop and then goes on to
> include the different /Library and /User..
> ./Library locations. So this is set as GRASS
> starts. It overrides anything I might set in a
> .profile

he seems to be doing the right thing:
64svn/macosx/app/grass.sh.in

# add some OS X style app support paths, and create user one if missing.
mkdir -p "$GISBASE_USER/Modules/bin"
if [ "$GRASS_ADDON_PATH" ] ; then
        GRASS_ADDON_PATH="$GRASS_ADDON_PATH:$GISBASE_USER/Modules/bin:$GISBASE_SYSTEM/Modules/bin"
else
        GRASS_ADDON_PATH="$GISBASE_USER/Modules/bin:$GISBASE_SYSTEM/Modules/bin"
fi
export GRASS_ADDON_PATH


i.e. if it exists add to it, otherwise start fresh.


> To clarify, I meant was that I can run g.gisenv
> and change GRASS_ADDON_PATH. Then run g.gisevn
> and my new setting shows up.
> 
> But this has no effect AFAICT.

right, GRASS_ADDON_PATH is an environment variable,
not a GRASS variable. It needs to be used before
grass starts up.

 
> setting GRASS_ADDON_PATH using export from the
> GRASS terminal (i.e., in a GRASS session) does
> not show up when I run g.gisenv,

right, they are two completely independent things,

> but does show up when I type $GRASS_ADDON_PATH
> 
> But neither way of setting it seems to have any
> effect on the value of $GRASS_ADDON_PATH used in
> g.extension (at least the version run from the
> menu)

changes in the terminal are only seen in that
terminal and children of that terminal. one process
can't hijack the settings of another one. If you
had started the gui from that terminal with g.gui
I expect it could have worked. but you can't adjust
an already running process from another one.

Hamish:
> > you need to set it before starting GRASS in
> > order for it to get picked up everywhere,
> > preferably in ~/.profile (or whatever
> > is appropriate for Macs) and you need to export
> > it there too
..
> export GRASS_ADDON_PATH="/User/cmbarton/Library/GRASS/6.4:/Library/GRASS/6.4..."

looks ok..

it's the first dir on the list which gets used by
g.extension(.*)


> GRASS behavior should not depend on environmental
> variables set from the shell prior to starting.

It has to be like that for a number of other things
too, GRASS_PYTHON for example... you may have had
it set in g.gisenv (you can put whatever you like
in there), but I can pretty much guarantee that it
won't have done anything.

if you 'export GRASS_ADDON_PATH=' from your .profile
it should be at the start of the list when you
type "echo $GRASS_ADDON_PATH" in the grass terminal,
followed by the ones that William added. (this
isn't an old migrated Mac user account using csh
instead of bash, right?)

If it's not, sorry I don't have a mac handy to test
on, it's probably just a simple miscommunication
somewhere.


Hamish


More information about the grass-dev mailing list