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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 16 10:28:16 PDT 2015


Author: martinl
Date: 2015-05-16 10:28:16 -0700 (Sat, 16 May 2015)
New Revision: 65256

Modified:
   grass/trunk/lib/init/grass.py
Log:
grass.py: promote TMPDIR environmental variable


Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2015-05-16 16:20:13 UTC (rev 65255)
+++ grass/trunk/lib/init/grass.py	2015-05-16 17:28:16 UTC (rev 65256)
@@ -283,6 +283,7 @@
         tmp = os.getenv('TMP')
     if not tmp:
         tmp = tempfile.gettempdir()
+    
     if tmp:
         tmpdir = os.path.join(tmp, "grass7-%(user)s-%(lock)s" % {'user': user,
                                                              'lock': gis_lock})
@@ -290,6 +291,7 @@
             os.mkdir(tmpdir, 0700)
         except:
             tmp = None
+    
     if not tmp:
         for ttmp in ("/tmp", "/var/tmp", "/usr/tmp"):
             tmp = ttmp
@@ -301,9 +303,13 @@
                 tmp = None
             if tmp:
                 break
+    
     if not tmp:
         fatal(_("Unable to create temporary directory <grass7-%(user)s-"
                 "%(lock)s>! Exiting.") % {'user': user, 'lock': gis_lock})
+    
+    os.environ['TMPDIR'] = tmpdir
+    
     return tmpdir
 
 



More information about the grass-commit mailing list