]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
improve env setting for configuration module - add git tag description in product...
authorcrouzet <nicolas.crouzet@cea.fr>
Wed, 31 Aug 2022 15:06:22 +0000 (17:06 +0200)
committercrouzet <nicolas.crouzet@cea.fr>
Wed, 31 Aug 2022 15:06:22 +0000 (17:06 +0200)
commands/compile.py
src/environment.py
src/product.py

index 252206d073e839d091f11d8c097d639916b11c72..043706be41529c8466792418f64aa34b88a63b1c 100644 (file)
@@ -245,9 +245,7 @@ def compile_all_products(sat, config, options, products_infos, all_products_dict
         # for configuration modules, check if sources are present
         for prod in all_products_dict:
             product_name, product_info = all_products_dict[prod]
-            if ("properties" in product_info and
-                "configure_dependency" in product_info.properties and
-                product_info.properties.configure_dependency == "yes"):
+            if src.product.product_is_configuration(product_info):
                 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" 
@@ -464,6 +462,10 @@ def compile_product(sat, p_name_info, config, options, logger, header, len_end):
     # product that have been successfully compiled
     if res==0:       
         logger.write(_("Add the config file in installation directory\n"), 5)
+        # for git bases : add the description of git tag
+        src_sha1=src.system.git_describe(p_info.source_dir)
+        if src_sha1:
+            p_info.git_tag_description=src_sha1
         src.product.add_compile_config_file(p_info, config)
         
         if options.check:
index 2deb56585d220be220bd744d221315714bfcb235..a706d5deab31149f876575522860b92198d41b46 100644 (file)
@@ -411,10 +411,20 @@ class SalomeEnviron:
         :param product_info Config: The product description
         :param logger Logger: The logger instance to display messages        
         """
-        # set root dir
         DBG.write("set_salome_minimal_product_env", product_info)
+
+        # set root dir
         root_dir = product_info.name + "_ROOT_DIR"
-        if 'install_dir' in product_info and product_info.install_dir:
+        
+        if src.product.product_is_configuration(product_info):
+            # configuration modules are not installed, root_dir points at source dir
+            if not self.for_package:
+                self.set(root_dir, product_info.source_dir)
+            else:
+                self.set(root_dir, os.path.join("out_dir_Path",
+                         "SOURCES",
+                         os.path.basename(product_info.source_dir)))
+        elif 'install_dir' in product_info and product_info.install_dir:
             self.set(root_dir, product_info.install_dir)
         elif not self.silent:
             logger.write("  " + _("No install_dir for product %s\n") %
@@ -447,6 +457,10 @@ class SalomeEnviron:
         
         :param pi Config: The product description
         """
+        if src.product.product_is_configuration(pi):
+            # configuration modules are not installed and should not be set like others
+            return
+
         # Construct XXX_ROOT_DIR
         env_root_dir = self.get(pi.name + "_ROOT_DIR")
         l_binpath_libpath = []
index 0413d212a415c5570e61f633b3409a0dd1f1b4b7..3b385b1e6578f45a2d3056de3bb7a13d71d1578e 100644 (file)
@@ -935,6 +935,18 @@ def product_is_salome(product_info):
             "is_SALOME_module" in product_info.properties and
             product_info.properties.is_SALOME_module == "yes")
 
+def product_is_configuration(product_info):
+    """Know if a product is a configuration module
+    
+    :param product_info Config: The configuration specific to 
+                               the product
+    :return: True if the product is a configuration module, else False
+    :rtype: boolean
+    """
+    return ("properties" in product_info and
+            "configure_dependency" in product_info.properties and
+            product_info.properties.configure_dependency == "yes")
+
 def product_is_fixed(product_info):
     """Know if a product is fixed