From ea31b25ee103ccc072369c3166133a56fb3eea55 Mon Sep 17 00:00:00 2001 From: Christian Van Wambeke Date: Thu, 2 Aug 2018 15:52:38 +0200 Subject: [PATCH] extension script file in pyconf, no obligation --- src/product.py | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/product.py b/src/product.py index ff713d7..0c6fe4b 100644 --- a/src/product.py +++ b/src/product.py @@ -218,26 +218,19 @@ No compilation script found for the product %s. Please provide a 'compil_script' key in its definition.""") % product_name raise src.SatException(msg) - # Get the path of the script + # Get the path of the script file + # if windows supposed '.bat', if linux supposed '.sh' + # but user set extension script file in his pyconf as he wants, no obligation. script = prod_info.compil_script script_name = os.path.basename(script) if script == script_name: # Only a name is given. Search in the default directory - script_path = src.find_file_in_lpath(script_name, - config.PATHS.PRODUCTPATH, - "compil_scripts") + script_path = src.find_file_in_lpath(script_name, config.PATHS.PRODUCTPATH, "compil_scripts") if not script_path: - raise src.SatException(_("Compilation script not found: %s") % script_name) + msg = _("Compilation script not found: %s") % script_name + DBG.tofix(msg, config.PATHS.PRODUCTPATH, True) # say where searched + raise src.SatException(msg) prod_info.compil_script = script_path - if src.architecture.is_windows(): - if ".sh" in script_path: - DBG.write("automatic switch '.sh' to '.bat' for script windows file", script_path, True) - prod_info.compil_script = prod_info.compil_script[:-len(".sh")] + ".bat" - else: - if ".bat" not in script_path: - DBG.write("No expected extension ('.sh' or '.bat') file name for script windows file", script_path, True) - else: - pass # mode olivier .bat present yet nothing to do # Check that the script is executable @@ -245,7 +238,8 @@ Please provide a 'compil_script' key in its definition.""") % product_name #raise src.SatException( # _("Compilation script cannot be executed: %s") % # prod_info.compil_script) - DBG.tofix("Compilation script cannot be executed:", prod_info.compil_script) + # just as warning, problem later... + DBG.tofix("Compilation script is not execute mode file", prod_info.compil_script, True) # Get the full paths of all the patches if product_has_patches(prod_info): -- 2.39.2