]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
sat #11028 dependance au module CONFIGURATION - remove also obsolete function in... nct/configuration_11028
authorcrouzet <nicolas.crouzet@cea.fr>
Tue, 3 Apr 2018 13:16:50 +0000 (15:16 +0200)
committercrouzet <nicolas.crouzet@cea.fr>
Tue, 3 Apr 2018 13:16:50 +0000 (15:16 +0200)
commands/compile.py
src/product.py

index f244dbaad62537902d978621e7fe6ef692e57273..903e64ba609b9fc04b42bcfb58e20cb453da3835 100644 (file)
@@ -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"))
index 3591f259513fbf87bfb8fc8259a88156f82bc692..5eb207942b5c2353bd22491ffaa46a5f8f03c543 100644 (file)
@@ -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