[GRASS-dev] GRASS extensions/addons mismatch

Michael Barton Michael.Barton at asu.edu
Tue Dec 20 15:44:48 EST 2011


See below


On Dec 16, 2011, at 7:07 PM, Hamish wrote:

> Michael wrote:
>> In preliminary tests (GRASS 6.4 svn release branch), this seems to work
>> very well--and in fact considerably better than it does with GRASS
>> 7/trunk at the moment.
> which one, the wxGUI extension tool or g.extension(.sh) from the command
> line? they are independent code. AFAIK William added some extra flags
> to the .sh version that are not present in the .py version, but I don't
> know if they are strictly needed anymore.

I did this from the wx menus. I did not realize that there are 2 such modules.

>> One of the extensions I test with consistently gives an install target
>> not found error in trunk, but installs fine with 6.4 release branch. 
> which one? note most addon modules are only in the grass6/ section of
> addons svn, and have not been ported to grass-addons/grass7/ yet.


>> BUT...
>> There remains some kind of weird problem with setting GRASS_ADDON_PATH.
>> By default, GRASS_ADDON_PATH is set to the desktop,
> ? what path exactly?
> do you set GRASS_ADDON_PATH yourself before starting GRASS? if so that
> one should be used and not ~/.grass6/addons/*

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

> which version of grass (AFAIK 6.5svn and trunk are now in sync, 6.4svn
> should work fine but does not contain the latest wingrass binary download
> logic)

6.4svn as of the date I reported

>> followed by the various /Library and ~/Library paths. I can
>> change it in the GRASS terminal and I can change it in the
>> GUI, but if I use $GRASS_ADDON_PATH in g.extension, it STILL
>> puts stuff into desktop (as the first path in
> right it installs to the first dir found in $GRASS_ADDON_PATH, as it
> has to pick one, might as well be the first.

Understood. But the odd thing is that I can change this path in several different places independently and changing that setting has no effects.

>> Moreover, I the changes made in GRASS_ADDON_PATH in the terminal do
>> not show up when I display settings from the GUI and the changes
>> made in GRASS_ADDON_PATH with the GUI do not show up in the
>> terminal--and neither are registered by g.extension.

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.

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, 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)

> 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
> from the terminal, did you "export" the enviro variable as well as setting
> it? otherwise it only exists in that terminal.

export GRASS_ADDON_PATH="/User/cmbarton/Library/GRASS/6.4:/Library/GRASS/6.4..."

>> If I hard code the directory to which I want to install
>> with g.extension, it puts stuff there. But the
>> GRASS_ADDON_PATH is borked up on the Mac.
> note that terminals and the gui do not communicate enviro vars with each 
> other: sibling and parent processes are indepenent, only with their direct
> launched children inherit exported vars from their parent.

I see.

But this is crazy for anyone running a Mac or Windows (and cumbersome for Linux users too). GRASS behavior should not depend on environmental variables set from the shell prior to starting. We have a mechanism for setting and saving parameters for a GRASS session from within GRASS--g.gisenv. That is what should be used. This is simple to implement in either a bash or Python script. In fact I seem to remember that I used to be able to set GRASS_ADDON_PATH in the .grassrc file and it was recognized. This would obviate the need to find some way to set this before start up and make it possible to change it during a GRASS session. My 2 cents on this.


> Hamish

More information about the grass-dev mailing list