]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
limitation des (trop nonbreux) appels à git describe
authorcrouzet <nicolas.crouzet@cea.fr>
Thu, 14 Feb 2019 14:44:19 +0000 (15:44 +0100)
committercrouzet <nicolas.crouzet@cea.fr>
Thu, 14 Feb 2019 14:44:19 +0000 (15:44 +0100)
commands/config.py
src/__init__.py
src/product.py

index b66f8e42c4c2e64b838da5c1e104f00155cf9036..ffcf669a33444d8cf72be0371fdcc478a210b0e1 100644 (file)
@@ -296,6 +296,15 @@ class ConfigManager:
         if cfg.LOCAL.archive_dir == "default":
             cfg.LOCAL.archive_dir = os.path.abspath( osJoin(cfg.VARS.salometoolsway, "..", "ARCHIVES"))
 
+        # if the sat tag was not set permanently by user
+        if cfg.LOCAL.tag == None:
+            # get the tag with git, and store it
+            sat_version=src.system.git_describe(cfg.VARS.salometoolsway) 
+            if sat_version == False:
+                sat_version=cfg.INTERNAL.sat_version
+            cfg.LOCAL.tag=sat_version
+                
+
         # apply overwrite from command line if needed
         for rule in self.get_command_line_overrides(options, ["LOCAL"]):
             exec('cfg.' + rule) # this cannot be factorized because of the exec
@@ -334,6 +343,12 @@ class ConfigManager:
             projects_cfg.PROJECTS.projects[project_name]=project_cfg
             projects_cfg.PROJECTS.projects[project_name]["file_path"] = \
                                                         project_pyconf_path
+            # store the project tag if any
+            product_project_git_tag = src.system.git_describe(os.path.dirname(project_pyconf_path))
+            if product_project_git_tag:
+                projects_cfg.PROJECTS.projects[project_name]["git_tag"] = product_project_git_tag
+            else:
+                projects_cfg.PROJECTS.projects[project_name]["git_tag"] = "unknown"
                    
         merger.merge(cfg, projects_cfg)
 
index ca569a05d6a89c5f85857af4e7e7a1dfbab07376..310c669f10e02a94be73fc8f6f1cf49dd04d6c7d 100644 (file)
@@ -234,15 +234,8 @@ def get_salometool_version(config):
    :param config Config: The global Config instance.
    :return: the description of this version of sat in terms of tag and commit
    """
-   # we use : 
-   # config.VARS.salometoolsway : the full path of salomeTool
-   # config.INTERNAL.sat_version : the static salomeTool version, 
-   # in case we are not in a git repo  
-   sat_version=system.git_describe(config.VARS.salometoolsway) 
-   if sat_version == False:
-       return config.INTERNAL.sat_version
-   else:
-       return sat_version
+   return config.LOCAL.tag
+
 
 def get_salome_version(config):
     import versionMinorMajorPatch as VMMP
index f18fc81e37718c46c1717c35010f1a6d8800b5e4..d20d9e4a52d485e61f1fb7764878376a76c3d78f 100644 (file)
@@ -171,13 +171,6 @@ def get_product_config(config, product_name, with_install_dir=True):
         # get salomeTool version
         prod_info.sat_version = src.get_salometool_version(config)
 
-        # get the product project git tag, if any
-        product_project_git_tag = src.system.git_describe(os.path.dirname(prod_info.from_file))
-        if product_project_git_tag:
-            prod_info.sat_project_tag = product_project_git_tag
-        else:
-            prod_info.sat_project_tag = "unknown"
-
         # merge opt_depend in depend
         if prod_info is not None and 'opt_depend' in prod_info:
             for depend in prod_info.opt_depend: