Przeglądaj źródła

init: do not remove wrong mapset .tmp, rely on clean_temp (see https://trac.osgeo.org/grass/ticket/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.


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73336 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 6 lat temu
rodzic
commit
ed6e0f2c72
1 zmienionych plików z 0 dodań i 9 usunięć
  1. 0 9
      lib/init/grass.py

+ 0 - 9
lib/init/grass.py

@@ -204,7 +204,6 @@ def cleanup_dir(path):
 class Cleaner(object):  # pylint: disable=R0903
 class Cleaner(object):  # pylint: disable=R0903
     """Holds directories and files which needs to be cleaned or deleted"""
     """Holds directories and files which needs to be cleaned or deleted"""
     def __init__(self):
     def __init__(self):
-        self.mapset_path = None
         self.tmpdir = None
         self.tmpdir = None
 
 
     def cleanup(self):
     def cleanup(self):
@@ -215,10 +214,6 @@ class Cleaner(object):  # pylint: disable=R0903
         # also tidy it up
         # also tidy it up
         cleanup_dir(self.tmpdir)
         cleanup_dir(self.tmpdir)
         try_rmdir(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):
 def fatal(msg):
@@ -2143,10 +2138,6 @@ def main():
 
 
     location = mapset_settings.full_mapset
     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
     # check and create .gislock file
     lock_mapset(mapset_settings.full_mapset, user=user,
     lock_mapset(mapset_settings.full_mapset, user=user,
                 force_gislock_removal=params.force_gislock_removal,
                 force_gislock_removal=params.force_gislock_removal,