[GRASS5] Re: [GRASSLIST:1325] Re: grassrc5 problems

[CC'd to the developers' list.]

William K wrote:

> GRASS_ADDON_PATH is an environment variable, not a GRASS variable;
> setting it in ~/.grassrc5 won't have any effect. You would have to set
> it in your shell's initialisation files (e.g. /etc/profile, ~/.profile
> etc; check the manual page for your shell to determine which files are
> read).

> Again, GRASS_WISH is an environment variable, not a GRASS variable.

Ah, I guess the difference wasn't clear to me. I think part of the
problem is the docs - the page on implemented environment variables
divides the two, and mentions briefly that env aren't set in grassrc5.
But the grass5 startup doc page

Can you provide more details as to exactly what you mean by "startup
doc page"? If it's a file, what is its name?

implies that you can set env variables in grassrc5,

That used to be true for the various -beta versions, and for some of
the earlier -pre versions, but it isn't true in 5.0.0 or later.

and gives an example: GRASS_GUI.

GRASS_GUI is a GRASS variable, not an environment variable.

And at least for GRASS_WISH, grassrc5 is used, just too late for the
select database dialog. After startup and I have the tcltkgrass menu,
GRASS_WISH _is_ set from what I specified in grassrc5.

OK; I see why that is happening. It's a side-effect of a shortcut
which is used in the start-up script. You shouldn't rely upon this
continuing to work in future versions. The correct mechanism is to
ensure that the variable is set in your environment before the
"grass5" script is run (e.g. via your shell's "rc" files).

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

Ah, I guess the difference wasn't clear to me. I think part of the
problem is the docs - the page on implemented environment variables
divides the two, and mentions briefly that env aren't set in grassrc5.
But the grass5 startup doc page

Can you provide more details as to exactly what you mean by "startup
doc page"? If it's a file, what is its name?

Can't seem to get to either Baylor or ITC right now to check, but it's there in the 'grass5' man page:

ENVIRONMENT VARIABLES
    User Interface Environment Variable
        The grass5 program will check for the existence of an
        environment variable called GRASS_GUI which indicates the
        type of user interface for GRASS to use. If this variable
        is not set when grass5 is run, then it will be created and
        then saved in the $HOME/.grassrc5 file for the next time
        GRASS is run.

        There is an order of precedence in the way grass5 deter-
        mines the user interface to use. The following is the
        hierarchy from highest precedence to lowest.

        The user may add own environment variable settings to
        $HOME/.grassrc5 file which are used during next startup of
        GRASS (list of implemented environment variables).

etc.

It's basically calling everything 'environment variables'. Confusing. I guess Markus needs to work on this one next, after he takes care of html/env_vars.html.

And at least for GRASS_WISH, grassrc5 is used, just too late for the
select database dialog. After startup and I have the tcltkgrass menu,
GRASS_WISH _is_ set from what I specified in grassrc5.

OK; I see why that is happening. It's a side-effect of a shortcut
which is used in the start-up script. You shouldn't rely upon this
continuing to work in future versions. The correct mechanism is to
ensure that the variable is set in your environment before the
"grass5" script is run (e.g. via your shell's "rc" files).

Ah.

-----
William Kyngesburye <kyngchaos@charter.net>
http://webpages.charter.net/kyngchaos/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect
RIP Douglas Adams 1952-2001

William K wrote:

>> Ah, I guess the difference wasn't clear to me. I think part of the
>> problem is the docs - the page on implemented environment variables
>> divides the two, and mentions briefly that env aren't set in grassrc5.
>> But the grass5 startup doc page
>
> Can you provide more details as to exactly what you mean by "startup
> doc page"? If it's a file, what is its name?
>
Can't seem to get to either Baylor or ITC right now to check, but it's
there in the 'grass5' man page:

OK, thanks.

ENVIRONMENT VARIABLES
    User Interface Environment Variable
        The grass5 program will check for the existence of an
        environment variable called GRASS_GUI which indicates the
        type of user interface for GRASS to use. If this variable
        is not set when grass5 is run, then it will be created and
        then saved in the $HOME/.grassrc5 file for the next time
        GRASS is run.

        There is an order of precedence in the way grass5 deter-
        mines the user interface to use. The following is the
        hierarchy from highest precedence to lowest.

        The user may add own environment variable settings to
        $HOME/.grassrc5 file which are used during next startup of
        GRASS (list of implemented environment variables).

OK, that appears to accurately describe the current behaviour,
although the current behaviour is probably wrong. As it stands, if
GRASS_GUI is set in the environment, the setting in $GISRC is ignored,
which is probably undesirable. E.g. if you use either the -text or
-tcltk switches, the GRASS_GUI setting is updated in $GISRC, so that
choice is remembered for future sessions.

etc.

It's basically calling everything 'environment variables'. Confusing.

Yep. It used to be even worse, (i.e. some programs would consult the
environment while others would consult $GISRC) but most of the actual
code was fixed by the time that 5.0.0 was released. OTOH, the
documentation appears to be a different matter.

The main reason for having GRASS variables distinct from environment
variables is that GRASS variables can be modified by programs, whereas
environment variables can't. This is likely to become even more
important in future, to allow for features such as being able to
switch between locations within a session.

I guess Markus needs to work on this one next, after he takes care of
html/env_vars.html.

The most recent change to env_vars.html made matters worse; it splits
the variables into GRASS variables and environment variables, but the
categorisation is incorrect. It may take some time to get this right.

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

On Tue, Sep 23, 2003 at 09:16:31AM +0100, Glynn Clements wrote:
[...]

> I guess Markus needs to work on this one next, after he takes care of
> html/env_vars.html.

The most recent change to env_vars.html made matters worse; it splits
the variables into GRASS variables and environment variables,

... which is generally no bad idea.

but the
categorisation is incorrect. It may take some time to get this right.

Sorry. So I will leave this to an expert.

Markus