[GRASS-dev] Re: [GRASS GIS] #1051: wxgui: SEARCH_PATH corruption

GRASS GIS trac at osgeo.org
Sun May 16 15:46:58 EDT 2010


#1051: wxgui: SEARCH_PATH corruption
-----------------------+----------------------------------------------------
  Reporter:  msieczka  |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect    |      Status:  new                      
  Priority:  critical  |   Milestone:  6.4.0                    
 Component:  wxGUI     |     Version:  svn-releasebranch64      
Resolution:            |    Keywords:                           
  Platform:  All       |         Cpu:  All                      
-----------------------+----------------------------------------------------
Comment (by glynn):

 Replying to [comment:3 msieczka]:

 > According to my tests, the SEARCH_PATH file, if present, overrides the
 default "current mapset 1st, PERMANENT 2nd, other mapsets next" behaviour,
 up to even excluding any mapset from the search path. Mapsets' order in
 the SEARCH_PATH file determines the search order too.

 Yep. If SEARCH_PATH doesn't exist, the default is the current mapset then
 PERMANENT. If SEARCH_PATH exists, it entirely specifies the search path;
 no other mapsets are searched, including the current and PERMANENT
 mapsets.

 g.mapsets ensures that the current mapset appears somewhere in the list
 (if it isn't, it will add it at the beginning), but libgis doesn't care.

 > I have attached a patch against SVN develbranch6, r42262. Please anybody
 let me know if it's acceptable. In general, it's purpose is to make
 'Mapset access' GUI work same as 'g.mapsets addmapset=/removemapset=',
 which:
 >
 > 1. Doesn't allow the user to remove the current mapset from the
 SEARCH_PATH.
 >
 > 2. The current mapset is always first in the SEARCH_PATH.

 g.mapsets allows other mapsets to be placed ahead of the current mapset.
 If the current mapset is entirely missing, it will add it to the head of
 the search path, but it won't move it if it's already present.

 > 3. Treats PERMANENT as any other mapset AFAICT. PERMANENT is the second
 in the search path only if the SEARCH_PATH file is not present.

 This is implemented in libgis; specifically by G_get_list_of_mapsets() in
 lib/gis/mapset_nme.c .

 The search path shouldn't really be relevant for the GUI, which should
 always be using qualified map names.

 However, to follow up on my previous comment:
 > If you intend to refer specifically to a map in the current mapset, you
 need to specify the mapset.
 I've probably forgotten this enough times. In fact, I'd guess that almost
 (?) every script which creates temporary maps subsequently refers to them
 using an unqualified name.

 In retrospect, I'd conclude that having anything ahead of the current
 mapset in the search path is asking for trouble. So I'm inclined suggest
 that G_get_list_of_mapsets() should be modified to forcibly place the
 current mapset at the head of the search path, even if SEARCH_PATH says
 otherwise.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/1051#comment:5>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list