]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
optional TOFIX 'make shutil.rmtree effective' in sat package
authorChristian Van Wambeke <christian.van-wambeke@cea.fr>
Wed, 18 Jul 2018 07:05:09 +0000 (09:05 +0200)
committerChristian Van Wambeke <christian.van-wambeke@cea.fr>
Wed, 18 Jul 2018 07:05:09 +0000 (09:05 +0200)
commands/package.py
src/debug.py

index dc132dd9426922c6d246ad34484c934206b18f1e..bc7a3fabcad2e4c2cfb3f646d71243762b36b1b1 100644 (file)
@@ -1434,7 +1434,8 @@ Please add it in file:
 
     logger.write(src.printcolors.printcLabel(_("Actually do the package")), 2)
     logger.write("\n", 2)
-    
+
+    res = 0
     try:
         # Creating the object tarfile
         tar = tarfile.open(path_targz, mode='w:gz')
@@ -1443,7 +1444,7 @@ Please add it in file:
         filter_function = exclude_VCS_and_extensions
 
         # Add the files to the tarfile object
-        res = add_files(tar, archive_name, d_files_to_add, logger, f_exclude=filter_function)
+        res = add_files(tar, archive_name, d_files_to_add, logger, f_exclude=filter_function)
         tar.close()
     except KeyboardInterrupt:
         logger.write(src.printcolors.printcError("\nERROR: forced interruption\n"), 1)
@@ -1459,8 +1460,8 @@ Please add it in file:
     if os.path.isdir(tmp_local_working_dir):
       shutil.rmtree(tmp_local_working_dir)
 
-    # to decide...
-    DBG.tofix("make shutil.rmtree('%s') effective" % tmp_working_dir, "", True)
+    # have to decide some time
+    DBG.tofix("make shutil.rmtree('%s') effective" % tmp_working_dir, "", DBG.isDevelopper())
     
     # Print again the path of the package
     logger.write("\n", 2)
index a3dbe2275daa6342d2ef1e60a4b8869bee7eb1c6..2023d8af738310d743bc46e1331ee0c3bd7d14f5 100755 (executable)
@@ -64,6 +64,11 @@ _user = os.environ['USER']
 _developpers = ["christian", "wambeke", "crouzet"] # crouzet, kloss ...
 
 
+def isDevelopper():
+    """if you are a developper, sometimes you want verbose traces etc."""
+    res = _user in _developpers
+    return res
+
 def indent(text, amount=2, ch=' '):
     """indent multi lines message"""
     padding = amount * ch