[GRASS5] The status of 5.0

Glynn Clements glynn.clements at virgin.net
Tue Mar 26 08:51:07 EST 2002


Glynn Clements wrote:

> > I find this a little confusing, as getenv() is used to get the values 
> > from the shell environment.  MAPSET, LOCATION_NAME and so on are in the 
> > gis environment, not in the shell environment.  getenv() shouldn't 
> > work.
> 
> Init.sh contains the line:
> 
> 	eval `g.gisenv`
> 
> This causes the contents of $GISRC to be reflected into the
> environment; i.e., for each GRASS variable, an environment variable is
> created with the same name and value.
> 
> This is currently necessary because most scripts just reference
> $LOCATION, $MAPSET etc, and expect those variables to be set. The
> scripts ought to be calling g.gisenv themselves to get the values;
> this would ensure that any changes to $GISRC which occurred during the
> session were visible to the scripts.

I've gone through src/scripts and added calls to g.gisenv where
necessary.

More significantly, I've changed g.gisenv not to generate "export"
statements, and Init.sh not to export LOCATION, so anything which
expects to find GISDBASE, LOCATION_NAME, MAPSET or LOCATION in the
environment will fail.

With the exception of the monitor auto-redraw code, it should be
possible to switch GISDBASE/LOCATION_NAME/MAPSET mid-session.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list