From 908276901f9d85c095da55893862810e7778de49 Mon Sep 17 00:00:00 2001 From: crouzet Date: Tue, 5 Feb 2019 11:30:22 +0100 Subject: [PATCH] sat #8691 (finalisation) : ajout message explicite d'erreur si pas de script lors de la compilation --- commands/script.py | 7 +++++++ src/debug.py | 5 +++-- src/logger.py | 2 +- src/product.py | 8 +------- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/commands/script.py b/commands/script.py index 575b56d..7345977 100644 --- a/commands/script.py +++ b/commands/script.py @@ -97,6 +97,13 @@ def run_script_of_product(p_name_info, nb_proc, config, logger): logger.write("\n", 3, False) return 0 + if not os.path.isfile(p_info.compil_script): + msg_err="\n\nError : The compilation script file do not exists!"+\ + "\n It was not found by sat!"+\ + "\n Please check your salomeTool configuration\n" + logger.error(msg_err) + return 1 + # Instantiate the class that manages all the construction commands # like cmake, make, make install, make test, environment management, etc... builder = src.compilation.Builder(config, logger, p_info) diff --git a/src/debug.py b/src/debug.py index 1b8cc47..1f48125 100755 --- a/src/debug.py +++ b/src/debug.py @@ -118,8 +118,9 @@ def tofix(title, var="", force=None): write sys.stderr a message if _debug[-1]==True or optionaly force=True use this only if no logger accessible for classic logger.warning(message) """ - fmt = "\n#### TOFIX: %s:\n%s\n" - write(title, var, force, fmt) + if _debug[-1] or isDeveloper(): + fmt = "\n#### TOFIX: %s:\n%s\n" + write(title, var, force, fmt) def push_debug(aBool): """set debug outputs activated, or not""" diff --git a/src/logger.py b/src/logger.py index 260b2ff..439b540 100755 --- a/src/logger.py +++ b/src/logger.py @@ -549,7 +549,7 @@ def isCurrentLoggerUnittest(): res = True else: res = False - DBG.write("isCurrentLoggerUnittest %s" % logger.name, res) + #DBG.write("isCurrentLoggerUnittest %s" % logger.name, res) return res def sendMessageToCurrentLogger(message, level): diff --git a/src/product.py b/src/product.py index 11ab001..f2fe8dd 100644 --- a/src/product.py +++ b/src/product.py @@ -295,18 +295,12 @@ Please provide a 'compil_script' key in its definition.""") % product_name if not script_path: msg = _("Compilation script %s not found in") % script_name DBG.tofix(msg, config.PATHS.PRODUCTPATH, True) # say where searched - # avoid stop if sat prepare, script could be included in sources, only warning - # raise src.SatException(msg) - script_path = "*** Not Found: %s" % script_name + script_path = "%s_(Not_Found_by_Sat!!)" % script_name prod_info.compil_script = script_path # Check that the script is executable if os.path.exists(prod_info.compil_script) and not os.access(prod_info.compil_script, os.X_OK): - #raise src.SatException( - # _("Compilation script cannot be executed: %s") % - # prod_info.compil_script) - # just as warning, problem later... DBG.tofix("Compilation script file is not in 'execute mode'", prod_info.compil_script, True) # Get the full paths of all the patches -- 2.39.2