[GRASS-dev] location invalid if PERMANENT contains no WIND file ?

Michael Barton michael.barton at asu.edu
Fri Dec 7 15:21:21 EST 2007


I agree. There is a larger issue that I think may still be unsolved (though
Hamish's post makes me wonder now). In the past, if the .grassrc6 file
pointed to an incorrect GISDBASE, LOCATION, or MAPSET value (i.e., one that
did not exist), GRASS will automatically go into text mode and exit.

IMHO, it should simply bring up the startup screen for selecting the proper
GISDBASE, LOCATION, and MAPSET. But it never got to the GUI.

Michael


On 12/7/07 8:53 AM, "Moritz Lennert" <mlennert at club.worldonline.be> wrote:

> On 07/12/07 10:42, Glynn Clements wrote:
>> Moritz Lennert wrote:
>> 
>>> In gis_set.tcl there is a check for a valid location which reads:
>>> 
>>> # All good locations have valid PERMANENT mapset.
>>>     if {[file exists "$dir/PERMANENT/WIND"] != 0} {
>>>        set found 1
>>> 
>>> Shouldn't this check for DEFAULT_WIND instead of WIND ?
>> 
>> I can see some sense in that. The only time that PERMANENT/WIND will
>> actually be used is if PERMANENT is used as the current mapset, which
>> may never happen. OTOH, PERMANENT/DEFAULT_WIND must exist in order to
>> create new mapsets.
>> 
> 
> In this particular case, I could not enter the location via the GUI
> startup, but had no problem using it via the text startup.
> 
> There is the same kind of test for mapsets (lines 499ff and 650ff):
> 
>                if {[file exists "$database/$location/$mapset/WIND"] == 0} {
>                      DialogGen .wrnDlg [G_msg "WARNING: invalid mapset"]
> warning \
>                      [format [G_msg "Warning: <%s> is not a valid
> mapset"] $mapset] \
>                      0 OK;
>                  }
> if { $mapset != "" && [file exists "$database/$location/$mapset/WIND"]
> != 0} {
>                      puts stdout "GISDBASE='$database';"
>                      puts stdout "LOCATION_NAME='$location';"
>                      puts stdout "MAPSET='$mapset';"
>                      putGRASSRC $gisrc_name
>                      exit 0
>                  }
>              }
> 
> 
> Again, should a missing WIND file be a reason to fail entering a mapset
> ? I think gis_set.tcl should just silently copy PERMANENT/DEFAULT_WIND
> to $mapset/WIND ?
> 
> Moritz
> 
> 

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

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



More information about the grass-dev mailing list