From cb2ab15f90e8f4f454f07a061c63924a91373778 Mon Sep 17 00:00:00 2001 From: crouzet Date: Tue, 3 Apr 2018 15:16:50 +0200 Subject: [PATCH] sat #11028 dependance au module CONFIGURATION - remove also obsolete function in product.py --- commands/compile.py | 24 ++++++++++++++++++++++++ src/product.py | 14 -------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/commands/compile.py b/commands/compile.py index f244dba..903e64b 100644 --- a/commands/compile.py +++ b/commands/compile.py @@ -346,6 +346,30 @@ def compile_all_products(sat, config, options, products_infos, logger): res += 1 #BUG continue + if src.product.product_is_salome(p_info): + # For salome modules, we check if the sources of configuration modules are present + # configuration modules have the property "configure_dependency" + + # get the list of all modules in application + all_products_infos = src.product.get_products_infos(config.APPLICATION.products, + config) + check_source = True + # for configuration modules, check if sources are present + for product_name, product_info in all_products_infos: + if ("properties" in product_info and + "configure_dependency" in product_info.properties and + product_info.properties.configure_dependency == "yes"): + check_source = check_source and src.product.check_source(product_info) + if not check_source: + logger.write(_("\nERROR : SOURCES of %s not found! It is required for" + " the configuration\n" % product_name)) + logger.write(_(" Get it with the command : sat prepare %s -p %s \n" % + (config.APPLICATION.name, product_name))) + if not check_source: + # if at least one configuration module is not present, we stop compilation + res += 1 + continue + # Check if it was already successfully installed if src.product.check_installation(p_info): logger.write(_("Already installed\n")) diff --git a/src/product.py b/src/product.py index 3591f25..5eb2079 100644 --- a/src/product.py +++ b/src/product.py @@ -567,20 +567,6 @@ def check_source(product_info): return False return True -def product_is_sample(product_info): - '''Know if a product has the sample type - - :param product_info Config: The configuration specific to - the product - :return: True if the product has the sample type, else False - :rtype: boolean - ''' - if 'type' in product_info: - ptype = product_info.type - return ptype.lower() == 'sample' - else: - return False - def product_is_salome(product_info): '''Know if a product is a SALOME module -- 2.39.2