<div dir="ltr"><div>Hi all,<br><br></div><div>I need opinions on how to resolve the question whether GRASS session can be started from another GRASS session. <br></div><div><br>Here we want to use GISBASE from environment instead of build constant if available:<br><br><a href="https://trac.osgeo.org/grass/changeset/45576">https://trac.osgeo.org/grass/changeset/45576</a><br><br>However, here we cause error when GISBASE already exists:<br><br><a href="http://trac.osgeo.org/grass/changeset/59210">http://trac.osgeo.org/grass/changeset/59210</a><br><br>But the check was removed in:<br><br><a href="http://trac.osgeo.org/grass/changeset/59220">http://trac.osgeo.org/grass/changeset/59220</a><br><br>because of:<br><br><a href="http://trac.osgeo.org/grass/ticket/2213">http://trac.osgeo.org/grass/ticket/2213</a><br><br>The point of r59210 was to make impossible to start another GRASS session within an existing session. However, r45576 is using exactly same check (GISBASE in env) to see if GISBASE is forced from outside. The two places for it are here:<br></div><div><br><a href="https://trac.osgeo.org/grass/browser/grass/trunk/lib/init/grass.py?annotate=blame&rev=65348#L48">https://trac.osgeo.org/grass/browser/grass/trunk/lib/init/grass.py?annotate=blame&rev=65348#L48</a><br><a href="https://trac.osgeo.org/grass/browser/grass/trunk/lib/init/grass.py?annotate=blame&rev=65348#L1633">https://trac.osgeo.org/grass/browser/grass/trunk/lib/init/grass.py?annotate=blame&rev=65348#L1633</a><br><br></div><div>I think starting non-interactive session (batch/exec mode) should be possible. Perhaps interactive session (--text & --gui) should have the check.<br><br>If the check is present (even just for the interactive sessions), the OSGeo4W version (and probably standalone winGRASS too) is going to break (needs to be changed somehow). Moreover, this would disallow setting some GISBASE to system for scripting purposes ("without starting explictly") and then starting a standard session.<br><br></div><div>The issue with the current state is that you cannot run different version of GRASS from a current session. More serious issue is that you cannot start another version if you have GISBASE in your system environment for scripting purposes (as mentioned above). The current behavior may also differ depending on a platform.<br><br></div><div>I'm not really sure what were the original intentions but I would prefer to switch the logic in r45576 and use GISBASE only if the path from compile time does not exist. This allows to override current session (GISBASE set in some way) but allows to supply the GISBASE when there is something wrong with compile time path. I would use some advice because I don't know how this works on Windows and Mac nor what grass.sh file is supposed to do.<br><br></div><div>Thanks,<br></div><div>Vaclav<br></div></div>