Salome HOME
merge the optimization branch
authorSPN Salome - CEA <support-salome@cea.fr>
Tue, 18 Apr 2017 14:30:26 +0000 (16:30 +0200)
committerSPN Salome - CEA <support-salome@cea.fr>
Tue, 18 Apr 2017 14:30:26 +0000 (16:30 +0200)
commands/compile.py
commands/config.py
commands/jobs.py
complete_sat.sh
src/internal_config/distrib.pyconf
src/product.py

index c7d0f2d9de38ef8d1e9120517ae69caf8533fe1b..e4a6449ea6f4645a1317841b7f18cca146af28de 100644 (file)
@@ -54,6 +54,9 @@ parser.add_option('', 'stop_first_fail', 'boolean', 'stop_first_fail', _(
 parser.add_option('', 'check', 'boolean', 'check', _(
                   "Optional: execute the unit tests after compilation"), False)
 
+parser.add_option('', 'clean_build_after', 'boolean', 'clean_build_after', 
+                  _('Optional: remove the build directory after successful compilation'), False)
+
 def get_products_list(options, cfg, logger):
     '''method that gives the product list with their informations from 
        configuration regarding the passed options.
@@ -377,7 +380,17 @@ def compile_all_products(sat, config, options, products_infos, logger):
                           batch=True,
                           verbose=0,
                           logger_add_link = logger)
-            
+        else:
+            # Clean the build directory if the compilation and tests succeed
+            if options.clean_build_after:
+                log_step(logger, header, "CLEAN BUILD")
+                sat.clean(config.VARS.application + 
+                          " --products " + p_name + 
+                          " --build",
+                          batch=True,
+                          verbose=0,
+                          logger_add_link = logger)
+
         # Log the result
         if res_prod > 0:
             logger.write("\r%s%s" % (header, " " * len_end_line), 3)
@@ -687,4 +700,4 @@ def run(args, runner, logger):
     code = res
     if code != 0:
         code = 1
-    return code
\ No newline at end of file
+    return code
index 0efbfbd105de9491d6bcb87f4c38202fa29b6b09..f36a628b1ab9f858a0aab014866c44591b636acc 100644 (file)
@@ -407,10 +407,9 @@ class ConfigManager:
                 if product_file_path:
                     products_dir = os.path.dirname(product_file_path)
                     try:
-                        prod_cfg = src.pyconf.Config(open(
-                                                    os.path.join(products_dir,
-                                                                 product_file_name)),
+                        prod_cfg = src.pyconf.Config(open(product_file_path),
                                                      PWD=("", products_dir))
+                        prod_cfg.from_file = product_file_path
                         products_cfg.PRODUCTS[product_name] = prod_cfg
                     except Exception as e:
                         msg = _(
@@ -583,9 +582,6 @@ def show_product_info(config, name, logger):
     logger.write(_("%s is a product\n") % src.printcolors.printcLabel(name), 2)
     pinfo = src.product.get_product_config(config, name)
     
-    # Type of the product
-    ptype = src.get_cfg_param(pinfo, "type", "")
-    src.printcolors.print_value(logger, "type", ptype, 2)
     if "depend" in pinfo:
         src.printcolors.print_value(logger, 
                                     "depends on", 
@@ -596,6 +592,20 @@ def show_product_info(config, name, logger):
                                     "optional", 
                                     ', '.join(pinfo.opt_depend), 2)
 
+    # information on pyconf
+    logger.write("\n", 2)
+    logger.write(src.printcolors.printcLabel("configuration:") + "\n", 2)
+    if "from_file" in pinfo:
+        src.printcolors.print_value(logger, 
+                                    "pyconf file path", 
+                                    pinfo.from_file, 
+                                    2)
+    if "section" in pinfo:
+        src.printcolors.print_value(logger, 
+                                    "section", 
+                                    pinfo.section, 
+                                    2)
+
     # information on prepare
     logger.write("\n", 2)
     logger.write(src.printcolors.printcLabel("prepare:") + "\n", 2)
index 8c863507ef92351ec6c98e7504020f9fe2149834..68224c493e5a9e8bc92ef4331615296cf1968b86 100644 (file)
@@ -518,7 +518,18 @@ class Job(object):
             try:
                 self.get_log_files()
             except Exception as e:
-                self.err += _("Unable to get remote log files: %s" % e)
+                # The 2 following lines must be suppressed after the bug is fixed
+                print("The error type: ")
+                print(type(e))
+                print("The error: ")
+                print(e)
+                print("Local scope:")
+                print(dir())
+                print("The str type: ")
+                print(type(str))
+                print("str: ")
+                print(str)
+                self.err += _("Unable to get remote log files!")
             
     def total_duration(self):
         """Give the total duration of the job
index 7be2d07c22b6d08764ea00c8d18d776f390e7d2a..4ac92f90bad6d57e4a5938296b856c24aa66f279 100755 (executable)
@@ -204,7 +204,7 @@ _salomeTools_complete()
             return 0
             ;;
         compile)
-            opts="--products --with_fathers --with_children --clean_all --make_flags --show --stop_first_fail --check"
+            opts="--products --with_fathers --with_children --clean_all --make_flags --show --stop_first_fail --check --clean_build_after"
             COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
             return 0
             ;;
index 949051110c6f2235f846fd753544042418b00212..a68a1e077757b2e959cf48ab6f06781ac0908eba 100644 (file)
@@ -54,7 +54,14 @@ VERSIONS :
     "CO":
     {
         "7.1.1503": "7.1"
-        "7.2.1511": "7.2"
-        "7.3.1611": "7.3"
+        "7.2.1511": "7"
+        "7.3.1611": "7"
+        "6.1" : "6"
+        "6.2" : "6"
+        "6.3" : "6"
+        "6.4" : "6"
+        "6.5" : "6"
+        "6.6" : "6"
+        "6.7" : "6"
     }
 }
index 3ee4847b2e3f4deaeb07a5626e9a96c992c47db5..b1c62ebab71db88dfe3c1dddeb4de2c2a3e7d4bc 100644 (file)
@@ -295,6 +295,7 @@ def get_product_section(config, product_name, version, section=None):
         # returns specific information for the given version
         prod_info = config.PRODUCTS[product_name][section]
         prod_info.section = section
+        prod_info.from_file = config.PRODUCTS[product_name].from_file
         return prod_info
 
     # If it exists, get the information of the product_version
@@ -302,6 +303,7 @@ def get_product_section(config, product_name, version, section=None):
         # returns specific information for the given version
         prod_info = config.PRODUCTS[product_name]["version_" + version]
         prod_info.section = "version_" + version
+        prod_info.from_file = config.PRODUCTS[product_name].from_file
         return prod_info
     
     # Else, check if there is a description for multiple versions
@@ -315,6 +317,7 @@ def get_product_section(config, product_name, version, section=None):
             # returns specific information for the versions
             prod_info = config.PRODUCTS[product_name][section_range]
             prod_info.section = section_range
+            prod_info.from_file = config.PRODUCTS[product_name].from_file
             return prod_info
     
     # Else, get the standard informations
@@ -322,6 +325,7 @@ def get_product_section(config, product_name, version, section=None):
         # returns the generic information (given version not found)
         prod_info = config.PRODUCTS[product_name].default
         prod_info.section = "default"
+        prod_info.from_file = config.PRODUCTS[product_name].from_file
         return prod_info
     
     # if noting was found, return None
@@ -784,4 +788,4 @@ def get_product_components(product_info):
         if isinstance(compo_list, str):
             compo_list = [ compo_list ]
 
-    return compo_list
\ No newline at end of file
+    return compo_list