[GRASS-dev] env variables not set

Hi,

I don't know if this is a local problem with my setup, but for some time now, MAPSET, LOCATION_NAME, and GISDBASE are not defined anymore in a running GRASS session. Just recompiled with fresh svn checkout, and the problem persists.

This means that I can't do things like

database=$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/

I don't see any relevant changes in lib/init/init.sh which could explain this, but before I dig deeper to find out what's going on I would like to hear whether anyone else has this problem.

Moritz

Moritz Lennert wrote:

I don't know if this is a local problem with my setup, but for some time
now, MAPSET, LOCATION_NAME, and GISDBASE are not defined anymore in a
running GRASS session. Just recompiled with fresh svn checkout, and the
problem persists.

This means that I can't do things like

database=$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/

I don't see any relevant changes in lib/init/init.sh which could explain
this, but before I dig deeper to find out what's going on I would like
to hear whether anyone else has this problem.

This was changed years ago (in 5.x, AFAICT; there doesn't appear to be
any way to obtain the revision history for 5.x now that CVS is gone).

The reason is that these settings can change during the life of a
GRASS session (e.g. g.mapset), but there's no way that a module can
can change the environment of the session shell (this is why we have
$GISRC rather than using environment variables).

You need to get the values from g.gisenv, e.g.:

  GISDBASE=`g.gisenv GISDBASE`
  LOCATION_NAME=`g.gisenv LOCATION_NAME`
  MAPSET=`g.gisenv MAPSET`
  LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"

--
Glynn Clements <glynn@gclements.plus.com>

On 07/01/08 12:52, Glynn Clements wrote:

Moritz Lennert wrote:

I don't know if this is a local problem with my setup, but for some time now, MAPSET, LOCATION_NAME, and GISDBASE are not defined anymore in a running GRASS session. Just recompiled with fresh svn checkout, and the problem persists.

This means that I can't do things like

database=$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/

I don't see any relevant changes in lib/init/init.sh which could explain this, but before I dig deeper to find out what's going on I would like to hear whether anyone else has this problem.

This was changed years ago (in 5.x, AFAICT; there doesn't appear to be
any way to obtain the revision history for 5.x now that CVS is gone).

Strange, I could have sworn that I have successfully done things like:

v.db.connect -o mylakes table=mylakes2 database=$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/

but I guess it must have been in my dreams...

Moritz

On 07/01/08 13:28, Moritz Lennert wrote:

Strange, I could have sworn that I have successfully done things like:

v.db.connect -o mylakes table=mylakes2 database=$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/

but I guess it must have been in my dreams...

Actually it does work, just have to use single-quotes, as clearly stated in TFM:

"Using variable as DBF directory definition, single quotes must be used:"

Sorry for the noise...

Moritz

On Jan 7, 2008 12:52 PM, Glynn Clements <glynn@gclements.plus.com> wrote:

Moritz Lennert wrote:

> I don't know if this is a local problem with my setup, but for some time
> now, MAPSET, LOCATION_NAME, and GISDBASE are not defined anymore in a
> running GRASS session. Just recompiled with fresh svn checkout, and the
> problem persists.
>
> This means that I can't do things like
>
> database=$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
>
> I don't see any relevant changes in lib/init/init.sh which could explain
> this, but before I dig deeper to find out what's going on I would like
> to hear whether anyone else has this problem.

This was changed years ago (in 5.x, AFAICT; there doesn't appear to be
any way to obtain the revision history for 5.x now that CVS is gone).

You can: example:

cd lib/gis/
svn log key_value1.c
------------------------------------------------------------------------
r23436 | glynn | 2007-04-15 01:02:01 +0200 (Sun, 15 Apr 2007) | 4 lines
Use "const" where appropriate
Use (void) instead of () for empty parameter lists
Use full type for function pointers
...
------------------------------------------------------------------------
r13833 | bernhard | 2004-11-09 13:18:56 +0100 (Tue, 09 Nov 2004) | 2 lines
copied within CVS repository from grass/src/libes/gis/key_value1.c
------------------------------------------------------------------------
r9499 | markus | 1999-12-29 16:10:05 +0100 (Wed, 29 Dec 1999) | 2 lines
Initial revision
------------------------------------------------------------------------

If you want a ChangeLog file, just get 'svn2cl', see
http://trac.osgeo.org/grass/wiki/HowToSVN

Also: The CVS should still work (and the old ChangeLog files are available).

Markus

Markus Neteler wrote:

> > I don't know if this is a local problem with my setup, but for some time
> > now, MAPSET, LOCATION_NAME, and GISDBASE are not defined anymore in a
> > running GRASS session. Just recompiled with fresh svn checkout, and the
> > problem persists.
> >
> > This means that I can't do things like
> >
> > database=$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
> >
> > I don't see any relevant changes in lib/init/init.sh which could explain
> > this, but before I dig deeper to find out what's going on I would like
> > to hear whether anyone else has this problem.
>
> This was changed years ago (in 5.x, AFAICT; there doesn't appear to be
> any way to obtain the revision history for 5.x now that CVS is gone).

You can: example:

cd lib/gis/
svn log key_value1.c
------------------------------------------------------------------------
r23436 | glynn | 2007-04-15 01:02:01 +0200 (Sun, 15 Apr 2007) | 4 lines
Use "const" where appropriate
Use (void) instead of () for empty parameter lists
Use full type for function pointers
...
------------------------------------------------------------------------
r13833 | bernhard | 2004-11-09 13:18:56 +0100 (Tue, 09 Nov 2004) | 2 lines
copied within CVS repository from grass/src/libes/gis/key_value1.c
------------------------------------------------------------------------
r9499 | markus | 1999-12-29 16:10:05 +0100 (Wed, 29 Dec 1999) | 2 lines
Initial revision
------------------------------------------------------------------------

It only goes back to 2002 for lib/init/init.sh. In 5.x, that file was
at src/general/init/init.sh.

Also, AFAICT you can't distinguish 5.x history from 6.x. There are SVN
branches for the 5.x CVS release branches, but not for the trunk.

If you want a ChangeLog file, just get 'svn2cl', see
http://trac.osgeo.org/grass/wiki/HowToSVN

Also: The CVS should still work (and the old ChangeLog files are available).

There is no CVS server on cvs.intevation.de:2402 any more. Is
anonymous (pserver) CVS still functional?

--
Glynn Clements <glynn@gclements.plus.com>