From 91864023fa972658308c8c4855cf8e6888f7b54f Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Sat, 4 May 2024 16:27:57 +0200 Subject: [PATCH] spns #40779: support multi repositories --- commands/compile.py | 4 ++-- commands/config.py | 1 - commands/package.py | 4 ++-- commands/prepare.py | 2 +- src/__init__.py | 4 ++-- src/environment.py | 4 ++-- src/product.py | 2 +- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/commands/compile.py b/commands/compile.py index 545a502..0c5fd5e 100644 --- a/commands/compile.py +++ b/commands/compile.py @@ -168,7 +168,7 @@ def compile_all_products(sat, config, options, products_infos, all_products_dict if src.product.product_is_salome(p_info): check_salome_configuration=True - if src.product.product_test_property(p_info,"is_opensource", "no") and not src.check_git_repository_has_non_opensource(config, config.APPLICATION.properties.git_server): + if src.product.product_test_property(p_info,"is_opensource", "no") and not src.check_git_server_has_non_opensource(config, config.APPLICATION.properties.git_server): continue # nothing to clean for native or fixed products if (not src.product.product_compiles(p_info)) or\ @@ -277,7 +277,7 @@ def compile_all_products(sat, config, options, products_infos, all_products_dict log_step(logger, header, "ignored") logger.write("\n", 3, False) continue - if src.product.product_test_property(p_info,"is_opensource", "no") and not src.check_git_repository_has_non_opensource(config, config.APPLICATION.properties.git_server): + if src.product.product_test_property(p_info,"is_opensource", "no") and not src.check_git_server_has_non_opensource(config, config.APPLICATION.properties.git_server): log_step(logger, header, "ignored") logger.write("\n", 3, False) continue diff --git a/commands/config.py b/commands/config.py index fa6a809..eec74a3 100644 --- a/commands/config.py +++ b/commands/config.py @@ -148,7 +148,6 @@ class ConfigManager: var['datadir'] = osJoin(var['salometoolsway'], 'data') if datadir is not None: var['datadir'] = datadir - var['personalDir'] = osJoin(os.path.expanduser('~'), '.salomeTools') src.ensure_path_exists(var['personalDir']) diff --git a/commands/package.py b/commands/package.py index 1eb702b..61b518d 100644 --- a/commands/package.py +++ b/commands/package.py @@ -686,7 +686,7 @@ def binary_package(config, logger, options, tmp_working_dir): if src.get_property_in_product_cfg(prod_info, "not_in_package") == "yes": continue - if src.product.product_is_not_opensource(prod_info) and src.check_git_repository_has_non_opensource( cfg, git_server): + if src.product.product_is_not_opensource(prod_info) and src.check_git_server_has_non_opensource( cfg, git_server): continue # Add the sources of the products that have the property @@ -1000,7 +1000,7 @@ def get_archives(config, logger): # skip product if git server misses non opensource products is_not_prod_opensource = src.product.product_is_not_opensource(p_info) git_server = src.get_git_server(config,logger) - has_git_server_non_opensource = src.check_git_repository_has_non_opensource( config, git_server) + has_git_server_non_opensource = src.check_git_server_has_non_opensource( config, git_server) if has_git_server_non_opensource and is_not_prod_opensource: logger.warning("%s is a closed-source software and is not available on %s" % (product, git_server)) continue diff --git a/commands/prepare.py b/commands/prepare.py index c86f769..c86d5d6 100644 --- a/commands/prepare.py +++ b/commands/prepare.py @@ -100,7 +100,7 @@ def run(args, runner, logger): git_server = src.get_git_server(runner.cfg,logger) - if src.check_git_repository_has_non_opensource( runner.cfg, git_server): + if src.check_git_server_has_non_opensource( runner.cfg, git_server): not_opensource_products = [p for p in products_infos if src.product.product_is_not_opensource(p[1])] listProd = [p for p in listProd if p not in [name for name, tmp in not_opensource_products]] diff --git a/src/__init__.py b/src/__init__.py index af2ef89..bbad2a7 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -623,8 +623,8 @@ def activate_mesa_property(config): config.APPLICATION.addMapping( 'properties', pyconf.Mapping(), None ) config.APPLICATION.properties.use_mesa="yes" -def check_git_repository_has_non_opensource( config, the_git_server): - """check that the git repository contains non public repositories +def check_git_server_has_non_opensource( config, the_git_server): + """check that the git repositories server contains non public repositories :param config class 'common.pyconf.Config': The config. :param logger Logger: The logging instance to use for the prints. """ diff --git a/src/environment.py b/src/environment.py index 525c4c5..f8df300 100644 --- a/src/environment.py +++ b/src/environment.py @@ -606,8 +606,8 @@ class SalomeEnviron: # skip product if git server misses non opensource products is_not_prod_opensource = src.product.product_is_not_opensource(pi) - git_server= get_fit_server(self.cfg, logger) - has_git_server_non_opensource = src.check_git_repository_has_non_opensource( self.cfg, git_server) + git_server= get_git_server(self.cfg, logger) + has_git_server_non_opensource = src.check_git_server_has_non_opensource( self.cfg, git_server) if has_git_server_non_opensource and is_not_prod_opensource: logger.warning("%s is a closed-source software and is not available on %s" % (pi.name, git_server)) return diff --git a/src/product.py b/src/product.py index a2f80f7..5bef97d 100644 --- a/src/product.py +++ b/src/product.py @@ -819,7 +819,7 @@ def get_products_list(options, cfg, logger): else: git_server = cfg.APPLICATION.properties.git_server - has_git_server_non_opensource = src.check_git_repository_has_non_opensource( cfg, git_server) + has_git_server_non_opensource = src.check_git_server_has_non_opensource( cfg, git_server) if has_git_server_non_opensource and not is_prod_opensource: logger.warning("%s is a closed-source software and is not available on %s" % (product, git_server)) continue -- 2.39.2