From 0c12724a7b7d3c5eb9e9f9133cc4576404143561 Mon Sep 17 00:00:00 2001 From: Christian Van Wambeke Date: Wed, 18 Jul 2018 09:05:09 +0200 Subject: [PATCH] optional TOFIX 'make shutil.rmtree effective' in sat package --- commands/package.py | 9 +++++---- src/debug.py | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/commands/package.py b/commands/package.py index dc132dd..bc7a3fa 100644 --- a/commands/package.py +++ b/commands/package.py @@ -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) diff --git a/src/debug.py b/src/debug.py index a3dbe22..2023d8a 100755 --- a/src/debug.py +++ b/src/debug.py @@ -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 -- 2.39.2