[GRASS-SVN] r73352 - grass/trunk/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 16 18:15:37 PDT 2018


Author: wenzeslaus
Date: 2018-09-16 18:15:37 -0700 (Sun, 16 Sep 2018)
New Revision: 73352

Modified:
   grass/trunk/lib/init/grass.py
Log:
init: use MAPSET_PATH instead of LOCATION for full path to current mapset variable (see #2681)

Changes the (local) shell variable used to refer to full path to the
current mapset from LOCATION to MAPSET_PATH. The name LOCATION was
a lagacy name (see also LOCATION_NAME) reintroduced in r60216
(not mentioned in the commit message, used locally like in the Python prompt).
The LOCATION is kept for backwards compatibility and can be safely removed
for the next major release (8.0).


Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2018-09-16 22:44:30 UTC (rev 73351)
+++ grass/trunk/lib/init/grass.py	2018-09-17 01:15:37 UTC (rev 73352)
@@ -1760,13 +1760,15 @@
         name=grass_name, version=grass_version, location=location_name))
 
     # TODO: have a function and/or module to test this
-    mask2d_test = 'test -f "$LOCATION/cell/MASK"'
-    mask3d_test = 'test -d "$LOCATION/grid3/RASTER3D_MASK"'
+    mask2d_test = 'test -f "$MAPSET_PATH/cell/MASK"'
+    mask3d_test = 'test -d "$MAPSET_PATH/grid3/RASTER3D_MASK"'
 
     # double curly brackets means single one for format function
+    # setting LOCATION for backwards compatibility
     f.write(
         """grass_prompt() {{
-    LOCATION="`g.gisenv get=GISDBASE,LOCATION_NAME,MAPSET separator='/'`"
+    MAPSET_PATH="`g.gisenv get=GISDBASE,LOCATION_NAME,MAPSET separator='/'`"
+    LOCATION="$MAPSET_PATH"
     if {mask2d_test} && {mask3d_test} ; then
         echo [{both_masks}]
     elif {mask2d_test} ; then



More information about the grass-commit mailing list