From b9e6051c562d5a43354f33fab32109d45cbc9d5a Mon Sep 17 00:00:00 2001 From: crouzet Date: Thu, 14 Feb 2019 15:44:19 +0100 Subject: [PATCH] =?utf8?q?limitation=20des=20(trop=20nonbreux)=20appels=20?= =?utf8?q?=C3=A0=20git=20describe?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- commands/config.py | 15 +++++++++++++++ src/__init__.py | 11 ++--------- src/product.py | 7 ------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/commands/config.py b/commands/config.py index b66f8e4..ffcf669 100644 --- a/commands/config.py +++ b/commands/config.py @@ -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) diff --git a/src/__init__.py b/src/__init__.py index ca569a0..310c669 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -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 diff --git a/src/product.py b/src/product.py index f18fc81..d20d9e4 100644 --- a/src/product.py +++ b/src/product.py @@ -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: -- 2.39.2