[GRASS-dev] location invalid if PERMANENT contains no WIND file ?
Michael Barton
michael.barton at asu.edu
Sat Dec 8 12:06:05 EST 2007
This sounds like a good idea.
Michael
On Dec 8, 2007, at 10:00 AM, grass-dev-request at lists.osgeo.org wrote:
> Send grass-dev mailing list submissions to
> grass-dev at lists.osgeo.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.osgeo.org/mailman/listinfo/grass-dev
> or, via email, send a message with subject or body 'help' to
> grass-dev-request at lists.osgeo.org
>
> You can reach the person managing the list at
> grass-dev-owner at lists.osgeo.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of grass-dev digest..."
> Today's Topics:
>
> 1. Re: location invalid if PERMANENT contains no WIND file ?
> (Glynn Clements)
>
> From: Glynn Clements <glynn at gclements.plus.com>
> Date: December 8, 2007 5:51:49 AM MST
> To: Moritz Lennert <mlennert at club.worldonline.be>
> Cc: grass-dev <grass-dev at lists.osgeo.org>
> Subject: Re: [GRASS-dev] location invalid if PERMANENT contains no
> WIND file ?
>
>
>
> 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 ?
>
> AFAIK, the idea is to prevent the user from selecting some random
> subdirectory of the location as the current mapset. This allows the
> location directory to have subdirectories which aren't mapsets and
> which won't be mistaken for mapsets.
>
> The convention is that $dir is a valid location if $dir/PERMANENT/WIND
> exists, and that $dir is a valid mapset if $dir/WIND exists.
>
> The former could reasonably be changed to look for
> $dir/PERMANENT/DEFAULT_WIND instead of $dir/PERMANENT/WIND. I don't
> think that the latter should be changed.
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>
>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
____________________
C. 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-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20071208/1e0c808a/attachment.html
More information about the grass-dev
mailing list