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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 15 19:08:00 PDT 2018


Author: wenzeslaus
Date: 2018-09-15 19:08:00 -0700 (Sat, 15 Sep 2018)
New Revision: 73336

Modified:
   grass/trunk/lib/init/grass.py
Log:
init: do not remove wrong mapset .tmp, rely on clean_temp (see #3635)


The previous behavior was deleting whole mapset temporary directory
of a mapset set at the startup. When started in mapset A, switched to B,
exited, whole .tmp of A was removed, B was cleaned by clean_temp.
Now cleaning of A is done during switching (as before) but it is not
touched again, so no running processed in a (new) session in A are
in denger of loosing temporary files. The mapset active at exit is
cleaning using clean_temp as before, but only by that.


Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2018-09-16 01:11:45 UTC (rev 73335)
+++ grass/trunk/lib/init/grass.py	2018-09-16 02:08:00 UTC (rev 73336)
@@ -204,7 +204,6 @@
 class Cleaner(object):  # pylint: disable=R0903
     """Holds directories and files which needs to be cleaned or deleted"""
     def __init__(self):
-        self.mapset_path = None
         self.tmpdir = None
 
     def cleanup(self):
@@ -215,10 +214,6 @@
         # also tidy it up
         cleanup_dir(self.tmpdir)
         try_rmdir(self.tmpdir)
-        if self.mapset_path:
-            tmpdir_mapset = os.path.join(self.mapset_path, ".tmp")
-            cleanup_dir(tmpdir_mapset)
-            try_rmdir(tmpdir_mapset)
 
 
 def fatal(msg):
@@ -2143,10 +2138,6 @@
 
     location = mapset_settings.full_mapset
 
-    # TODO: it seems that we are claiming mapset's tmp before locking
-    # (this is what the original code did but it is probably wrong)
-    cleaner.mapset_path = mapset_settings.full_mapset
-
     # check and create .gislock file
     lock_mapset(mapset_settings.full_mapset, user=user,
                 force_gislock_removal=params.force_gislock_removal,



More information about the grass-commit mailing list