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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 21 14:45:19 PDT 2015


Author: martinl
Date: 2015-05-21 14:45:19 -0700 (Thu, 21 May 2015)
New Revision: 65307

Modified:
   grass/trunk/lib/init/grass.py
Log:
grass.py: don't overwrite environmental variables in bash_startup()


Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2015-05-21 21:01:15 UTC (rev 65306)
+++ grass/trunk/lib/init/grass.py	2015-05-21 21:45:19 UTC (rev 65307)
@@ -984,7 +984,13 @@
             k, v = map(lambda x: x.strip(), line.strip().split(' ', 1)[1].split('=', 1))
         except:
             continue
+        
+        if k in ('TMPDIR', 'TEMP', 'TMP'):
+            continue # don't overwrite TMPDIR set by create_tmp()
+        
+        debug("Environmental variable set {}={}".format(k, v))
         os.environ[k] = v
+        
     # Allow for mixed ISIS-GRASS Environment
     if os.getenv('ISISROOT'):
         isis = os.getenv('ISISROOT')
@@ -1443,9 +1449,7 @@
     path = os.path.join(userhome, ".grass.bashrc") # left for backward compatibility
     if os.access(path, os.R_OK):
         f.write(readfile(path) + '\n')
-    if os.access(grass_env_file, os.R_OK):
-        f.write(readfile(grass_env_file) + '\n')
-
+    
     f.write("export PATH=\"%s\"\n" % os.getenv('PATH'))
     f.write("export HOME=\"%s\"\n" % userhome) # restore user home path
 



More information about the grass-commit mailing list