[GRASS-dev] missing grass configuration files

Where is GRASS saving its configuration preferences now?

A short while back, Martin switched the location of the wxGUI configuration files to ~/.grass7/wx. After a bug fix for preferences saving Sunday, this is working fine.

But where is the .grassrc7 file or its equivalent?

Nothing is being created in the ~/.grass7 directory and I no longer have a .grassrc7 file. Init.sh refers to $GRASS_CONFIG_DIR, but this does not seem to be set when I check it from the GRASS terminal. BUT GRASS starts up with some kind of configuration because it saves my mapset/location preferences. So where is this?

Michael


C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://csdc.asu.edu, http://shesc.asu.edu
http://www.public.asu.edu/~cmbarton

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?

Michael

On Dec 8, 2009, at 11:07 AM, Michael Barton wrote:

Where is GRASS saving its configuration preferences now?

A short while back, Martin switched the location of the wxGUI configuration files to ~/.grass7/wx. After a bug fix for preferences saving Sunday, this is working fine.

But where is the .grassrc7 file or its equivalent?

Nothing is being created in the ~/.grass7 directory and I no longer have a .grassrc7 file. Init.sh refers to $GRASS_CONFIG_DIR, but this does not seem to be set when I check it from the GRASS terminal. BUT GRASS starts up with some kind of configuration because it saves my mapset/location preferences. So where is this?

Michael


C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://csdc.asu.edu, http://shesc.asu.edu
http://www.public.asu.edu/~cmbarton

Just curious - I haven't looked at the config folder changes yet: is the config folder path configurable at compile time or runtime? What would be nice is to set platform-specific locations, like ~/Library/Preferences/grass7 on OSX, instead of the non-Mac-like hidden dot folder.

And not just hidden folders, but files also, like .grassrc7.

On Dec 8, 2009, at 12:12 PM, 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?

Michael

On Dec 8, 2009, at 11:07 AM, Michael Barton wrote:

Where is GRASS saving its configuration preferences now?

A short while back, Martin switched the location of the wxGUI configuration files to ~/.grass7/wx. After a bug fix for preferences saving Sunday, this is working fine.

But where is the .grassrc7 file or its equivalent?

Nothing is being created in the ~/.grass7 directory and I no longer have a .grassrc7 file. Init.sh refers to $GRASS_CONFIG_DIR, but this does not seem to be set when I check it from the GRASS terminal. BUT GRASS starts up with some kind of configuration because it saves my mapset/location preferences. So where is this?

Michael
______________________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://csdc.asu.edu, http://shesc.asu.edu
    http://www.public.asu.edu/~cmbarton

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

All generalizations are dangerous, even this one.

That would work OK AFAIC. I also just learned that all those file that were being searched for by the startup script are also ending up in HOME instead of either Application Support or .grass7.

I guess I'd lean toward the .grass7 solution. This is not like "real" Mac programs, but a number of cross-platform Mac programs do this.

Here is what is bring this up. We have a Java based ABM that interacts with GRASS. It needs to access the GRASS configuration files and to set the environment for GRASS in order to run correctly with GRASS. This has changed rather dramatically with GRASS 7 (I'm sending a separate post on a related question).

Wherever this stuff goes, it needs to be in a place that it can be easily 'found' across platforms in a consistent way. It could be a path stored in an environmental variable, for example if that is accessible.

Michael
______________________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://csdc.asu.edu, http://shesc.asu.edu
    http://www.public.asu.edu/~cmbarton

On Dec 8, 2009, at 11:23 AM, William Kyngesburye wrote:

Just curious - I haven't looked at the config folder changes yet: is the config folder path configurable at compile time or runtime? What would be nice is to set platform-specific locations, like ~/Library/Preferences/grass7 on OSX, instead of the non-Mac-like hidden dot folder.

And not just hidden folders, but files also, like .grassrc7.

On Dec 8, 2009, at 12:12 PM, 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?

Michael

On Dec 8, 2009, at 11:07 AM, Michael Barton wrote:

Where is GRASS saving its configuration preferences now?

A short while back, Martin switched the location of the wxGUI configuration files to ~/.grass7/wx. After a bug fix for preferences saving Sunday, this is working fine.

But where is the .grassrc7 file or its equivalent?

Nothing is being created in the ~/.grass7 directory and I no longer have a .grassrc7 file. Init.sh refers to $GRASS_CONFIG_DIR, but this does not seem to be set when I check it from the GRASS terminal. BUT GRASS starts up with some kind of configuration because it saves my mapset/location preferences. So where is this?

Michael
______________________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://csdc.asu.edu, http://shesc.asu.edu
    http://www.public.asu.edu/~cmbarton

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
grass-dev Info Page

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

All generalizations are dangerous, even this one.

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@gclements.plus.com>

On Dec 8, 2009, at 1:58 PM, Glynn Clements wrote:

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".

Or better

if [ ! "$GRASS_CONFIG_DIR" ] ; then
  GRASS_CONFIG_DIR=@GRASS_CONFIG_DIR@
  export $GRASS_CONFIG_DIR
fi

so it can be overridden by the grass startup to define a build-specific location.

...which I just added in r39949.

Michael - I also updated the scripts that were using the old user addon paths, and made the startup override GRASS_CONFIG_DIR so that it's in the user's Preferences folder on OSX instead of the hidden folder (also more secure).

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"We are at war with them. Neither in hatred nor revenge and with no particular pleasure I shall kill every ___ I can until the war is over. That is my duty."

"Don't you even hate 'em?"

"What good would it do if I did? If all the many millions of people of the allied nations devoted an entire year exclusively to hating the ____ it wouldn't kill one ___ nor shorten the war one day."

<Ha, ha> "And it might give 'em all stomach ulcers."

- Tarzan, on war

Thanks a million. This project is so great.

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

Phone: 480-965-6262
Fax: 480-965-7671
www: www.public.asu.edu/~cmbarton, http://csdc.asu.edu

On Dec 8, 2009, at 6:15 PM, William Kyngesburye wrote:

On Dec 8, 2009, at 1:58 PM, Glynn Clements wrote:

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".

Or better

if [ ! "$GRASS_CONFIG_DIR" ] ; then
  GRASS_CONFIG_DIR=@GRASS_CONFIG_DIR@
  export $GRASS_CONFIG_DIR
fi

so it can be overridden by the grass startup to define a build-specific location.

...which I just added in r39949.

Michael - I also updated the scripts that were using the old user addon paths, and made the startup override GRASS_CONFIG_DIR so that it's in the user's Preferences folder on OSX instead of the hidden folder (also more secure).

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"We are at war with them. Neither in hatred nor revenge and with no particular pleasure I shall kill every ___ I can until the war is over. That is my duty."

"Don't you even hate 'em?"

"What good would it do if I did? If all the many millions of people of the allied nations devoted an entire year exclusively to hating the ____ it wouldn't kill one ___ nor shorten the war one day."

<Ha, ha> "And it might give 'em all stomach ulcers."

- Tarzan, on war

Hi,

2009/12/8 Michael Barton <michael.barton@asu.edu>:

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?

No, it's desired feature - to store all GRASS config files on one place.

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa