[GRASS-dev] Re: [GRASS-user] GRASS 6.3 Installation Woes on OS X

If you have a .grassrc6 file that has a set gisdbase, location, and/or
mapset (e.g., from using GRASS previously) and then you delete or rename any
of the above, GRASS init.sh will generate an error and GRASS will crash on
launch with the error message below.

The only fix is to either make the gisdbase, location, or mapset directory
that is listed in .grassrc6, or directly edit .grassrc6 to change or remove
the offending line.

Init.sh needs to trap this kind of error--or maybe better just ignore it. If
any of these files is not present, GRASS should simply go to either a) the
initial text based startup screen if the text interface or no interface is
selected in .grassrc6, or b) go to the GUI for selecting
gisdbase/location/mapset as if the gisdbase/location/mapset line was missing
from .grassrc6. In any case this should not cause a crash.

Michael

ERROR ON STARTUP WITH INCORRECT LOCATION SET IN .GRASSRC6

access: No such file or directory
ERROR: LOCATION << /Users/Shared/grassdata/test6 >> not available
Traceback (most recent call last):
  File
"/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/gis_set.py",
line 749, in <module>
    GRASSStartUp = StartUp(0)
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packag
es/wx-2.8-mac-ansi/wx/_core.py", line 7757, in __init__
    self._BootstrapApp()
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packag
es/wx-2.8-mac-ansi/wx/_core.py", line 7354, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File
"/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/gis_set.py",
line 740, in OnInit
    StartUp = GRASSStartup(None, -1, "")
  File
"/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/gis_set.py",
line 463, in __init__
    self.__set_properties()
  File
"/Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/wx/gis_set.py",
line 515, in __set_properties
    self.lblocations.SetSelection(self.listOfLocations.index(location))
ValueError: list.index(x): x not in list
/Users/Shared/grassdata/test6/PERMANENT/.gislock: No such file or directory
ERROR: /Applications/Grass/GRASS-6.3.app/Contents/Resources/etc/lock:
cmbarton is currently running GRASS in selected mapset (file
/Users/Shared/grassdata/test6/PERMANENT/.gislock found). Concurrent use not
allowed.
logout
[Process completed]

On 7/11/07 10:41 AM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

On Jul 11, 2007, at 12:25 PM, Ryan Rosario wrote:

Thanks. All I have seen is .grassrc6 but that must have been from
Lorenzo's build. To get a similar environment I just created a
grass directory under /Users/ryan and then entered /Users/ryan/
grass into the GIS Data Directory field. I no longer get the error
I asked about.

Another user recommended creating my own .grassrc6 file which has
apparently worked for other users, but it seems that my way works
as well (both methods are probably doing the same thing). I
downloaded the Spearfish dataset and all appears good as new.

The .grassrc6 file is (it should be) created automatically the first
time you run GRASS. I'm not sure, but it may require a successful
location/mapset selection/creation - ie you get the main GRASS
command prompt.

There is no need to create .grassrc6 before running GRASS. Or to
edit it after creation, GRASS' g.gisenv maintains it.

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

"Time is an illusion - lunchtime doubly so."

- Ford Prefect

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

On Jul 11, 2007, at 8:26 PM, Michael Barton wrote:

If you have a .grassrc6 file that has a set gisdbase, location, and/or
mapset (e.g., from using GRASS previously) and then you delete or rename any
of the above, GRASS init.sh will generate an error and GRASS will crash on
launch with the error message below.

The only fix is to either make the gisdbase, location, or mapset directory
that is listed in .grassrc6, or directly edit .grassrc6 to change or remove
the offending line.

Ah, yeah, that's an annoying one. Though the text and TclTk GUI don't quit, just notify you of the problem.

Init.sh needs to trap this kind of error--or maybe better just ignore it. If
any of these files is not present, GRASS should simply go to either a) the
initial text based startup screen if the text interface or no interface is
selected in .grassrc6, or b) go to the GUI for selecting
gisdbase/location/mapset as if the gisdbase/location/mapset line was missing
from .grassrc6. In any case this should not cause a crash.

Part of the problem, specifically for the OSX app startup, is that double-clicking the app doesn't give you the option to start directly into a mapset, like you can do with 'grass6 /path/to/location/mapset/map' from the command line, or adding -text to the startup command, so it makes editing .grassrc6 necessary to correct problems.

I just thought of one thing I can do for the app startup - drag-n-drop. I can have the AppleScript app take a folder dropped onto it as the '/path/to/location/mapset/map' option. I didn't use /path/to/location/mapset/map much in the past, so it didn't occur to me to use drag-n-drop in the app :slight_smile:

The selection of text/gui startup I deliberately avoided in the app startup, because I didn't want a dialog at startup every time, like Lorenzo does in his binary. I wonder if I can get AppleScript to intercept a modifier like shift or option at startup, hmmm...

[wanders off to ponder AppleScript ideas...]

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

Earth: "Mostly harmless"

- revised entry in the HitchHiker's Guide to the Galaxy