[GRASS-dev] Re: missing grass configuration files

Glynn Clements glynn at gclements.plus.com
Tue Dec 8 14:58:37 EST 2009


Michael Barton wrote:

> I found the file. It is now called "rc" but it is not ending up in  
> ~/.grass7. Instead, it is just going into HOME.
> 
> So this is a bug somewhere, but I'm not sure where. In Init.sh?

lib/init/*.

lib/init/Makefile replaces @GRASS_CONFIG_DIR@ with $(GRASS_CONFIG_DIR)
in init.sh, grass.py and init.bat. However:

1. init.sh uses $GRASS_CONFIG_DIR, but doesn't define it; it needs a
line like:

	GRASS_CONFIG_DIR=@GRASS_CONFIG_DIR@

GISRC is defined as:

	GISRCRC="$HOME/$GRASS_CONFIG_DIR/rc"

so the missing definition for GRASS_CONFIG_DIR causes it to be set to
"$HOME//rc".

2. init.bat doesn't even reference it, so substituting is pointless.

The grass.py script is correct:

	grass_config_dir = os.path.join(os.getenv('HOME'), "@GRASS_CONFIG_DIR@")

On Unix, you get grass70 (Python) and grass70.sh (Bourne shell). On
Windows, you get grass70.py, grass70.sh and grass70.bat; if you don't
give an extension, which one gets used presumably depends upon
%PATHEXT%.

The "active" version should still be created as
/tmp/grass7-<user>-<pid>/gisrc, but that will only happen if the
$GISRCRC file (should be ~/.grass7/rc but is ~/rc due to this bug)
exists.

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


More information about the grass-dev mailing list