Browse Source

grass.py: don't overwrite environmental variables in bash_startup()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@65307 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 10 years ago
parent
commit
b877ea2bb3
1 changed files with 7 additions and 3 deletions
  1. 7 3
      lib/init/grass.py

+ 7 - 3
lib/init/grass.py

@@ -984,7 +984,13 @@ def load_env(grass_env_file):
             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 @@ PROMPT_COMMAND=grass_prompt\n""" % (_("2D and 3D raster MASKs present"),
     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