Browse Source

init: remove broken env var interface for d/l/m

The interface described in the manual was not implemented and not part of --help.
It seems that it was broken at least since trans from Bash to Python (https://trac.osgeo.org/grass/changeset/37863)
and definitevely before refactoring in r65235. Perhaps some time after env vars
were definitevely removed from modules (https://trac.osgeo.org/grass/changeset/10655, https://trac.osgeo.org/grass/changeset/10790, https://trac.osgeo.org/grass/changeset/10793).

Closes https://trac.osgeo.org/grass/ticket/2679 (Drop or fix setting...) and see https://trac.osgeo.org/grass/ticket/2681 for more explanation
esp. about the unfortunate naming (LOCATION vs LOCATION_NAME).

This removes the only code which seemed to be really specific for
the grass - call and it removes a significat portion of the manual
which discusses usage and env vars and command line params priorities 
in various combinations.


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@72791 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 7 years ago
parent
commit
e7fae71da4
2 changed files with 3 additions and 91 deletions
  1. 3 22
      lib/init/grass.py
  2. 0 69
      lib/init/grass7.html

+ 3 - 22
lib/init/grass.py

@@ -900,28 +900,9 @@ def set_mapset(gisrc, arg=None, geofile=None, create_new=False,
 
     tmp_location requires tmpdir (which is used as gisdbase)
     """
-    # TODO: arg param seems to be always mapset or dash, refactor
-    l = None
-
-    if arg == '-':
-        # TODO: repair or remove behavior env vars + `grass75 -` (see doc)
-        # this is broken for some time (before refactoring, e.g. r65235)
-        # is some code is added, it should be a separate function, probably
-        # called here
-        # older comment for global vars:
-        # TODO: it does not seem that these would be ever set before calling this
-        # function, so we may just delete them here (the globals are set from
-        # the gisrc later on). But where is setting from environmental variables?
-        # the following probable means if env var defined, use it
-        # originates from r37863 (Convert grass70 script to Python) but even
-        # there it seems that it will never succeed
-        # it would have to be defined also for other vars
-        # if location:
-        #    l = location
-        pass
-    else:
-        l = arg
-
+    # TODO: arg param seems to be always the mapset parameter (or a dash
+    # in a distant past), refactor
+    l = arg
     if l:
         if l == '.':
             l = os.getcwd()

+ 0 - 69
lib/init/grass7.html

@@ -414,75 +414,6 @@ the script (like <tt>#!/bin/sh</tt>, <tt>#!/bin/bash</tt>, or <tt>#!/usr/bin/env
 indicating which interpreter to be used for the script. The script file must 
 have its executable bit set. 
 
-<h3>Other examples</h3>
-
-There are a variety of ways in which the <i>location environment
-variables</i> (see above) can be used to specify the mapset to use.
-The following are some possible examples.
-
-<h4>Example 1</h4>
-
-The environment variables are defined as follows:
-    
-<div class="code"><pre>
-LOCATION = /usr/local/share/grassdata/spearfish70/PERMANENT
-GISDBASE = /usr/local/share/grassdata
-LOCATION_NAME = spearfish70
-MAPSET = PERMANENT
-</pre></div>
-
-Start GRASS with the following command:
-
-<div class="code"><pre>
-grass75 -
-</pre></div>
-
-GRASS will start with the mapset defined by LOCATION since the LOCATION
-variable overrides the other variables.
-
-<h4>Example 2</h4>
-
-The environment variables are defined as follows:
-    
-<div class="code"><pre>
-GISDBASE = /usr/local/share/grassdata
-LOCATION_NAME = spearfish70
-MAPSET = PERMANENT
-</pre></div>
-
-Start GRASS with the following command:
-
-<div class="code"><pre>
-grass75 -
-</pre></div>
-    
-GRASS will start with the mapset defined by
-GISDBASE/LOCATION_NAME/MAPSET.
-
-<div class="code"><pre>
-grass75 /usr/home/grass/data/thailand/forests
-</pre></div>
-    
-GRASS will start with the
-mapset <tt>/home/grass/data/thailand/forests</tt> which overrides the
-environment variables.
-
-<div class="code"><pre>
-grass75 swamps
-</pre></div>
-
-GRASS will start with the mapset defined by
-GISDBASE/LOCATION_NAME/swamps since the command line argument for the
-mapset overrides the environment variable MAPSET.
-
-<div class="code"><pre>
-grass75 thailand/forests
-</pre></div>
-
-GRASS will start with the mapset defined by GISDBASE/thailand/forests
-since the command line arguments for the location and mapset overrides
-the environment variables LOCATION_NAME and MAPSET.
-
 <h2>CAVEAT</h2>
 
 If you start GRASS using the <em><a href="wxGUI.html">wxGUI</a></em>