From be70d7b39443578d54f380d0f1e44252d5940d18 Mon Sep 17 00:00:00 2001 From: crouzet Date: Fri, 7 May 2021 16:37:31 +0200 Subject: [PATCH] specialisation des paquets systemes par distribution, pour mieux gerer les differences --- commands/config.py | 2 +- commands/source.py | 2 +- src/product.py | 26 ++++++++++++++++---------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/commands/config.py b/commands/config.py index 6ef3dbf..e855c57 100644 --- a/commands/config.py +++ b/commands/config.py @@ -815,7 +815,7 @@ def check_install_system(config, logger): if src.product.product_is_native(product_info): # if the product is native, get (in two dictionnaries the runtime and compile time # system dependencies with the status (OK/KO) - run_pkg,build_pkg=src.product.check_system_dep(check_cmd, product_info) + run_pkg,build_pkg=src.product.check_system_dep(config.VARS.dist, check_cmd, product_info) #logger.write("\n*** %s ***\n" % product, 1) for pkg in run_pkg: logger.write("\n - "+pkg + " : " + run_pkg[pkg], 1) diff --git a/commands/source.py b/commands/source.py index 47d8d15..d92ddc5 100644 --- a/commands/source.py +++ b/commands/source.py @@ -405,7 +405,7 @@ def get_product_sources(config, # for native products we check the corresponding system packages are installed logger.write("Native : Checking system packages are installed\n" , 3) check_cmd=src.system.get_pkg_check_cmd(config.VARS.dist_name) # (either rmp or apt) - run_pkg,build_pkg=src.product.check_system_dep(check_cmd, product_info) + run_pkg,build_pkg=src.product.check_system_dep(config.VARS.dist, check_cmd, product_info) result=True for pkg in run_pkg: logger.write(" - "+pkg + " : " + run_pkg[pkg], 1) diff --git a/src/product.py b/src/product.py index 5bb0c16..bbeeffa 100644 --- a/src/product.py +++ b/src/product.py @@ -856,7 +856,7 @@ def check_installation(config, product_info): if product_is_native(product_info): # check a system product check_cmd=src.system.get_pkg_check_cmd(config.VARS.dist_name) - run_pkg,build_pkg=src.product.check_system_dep(check_cmd, product_info) + run_pkg,build_pkg=src.product.check_system_dep(config.VARS.dist, check_cmd, product_info) build_dep_ko=[] for pkg in build_pkg: if "KO" in build_pkg[pkg]: @@ -1220,8 +1220,9 @@ def product_test_property(product_info, property_name, property_value): result = eval(eval_expression) return result -def check_system_dep(check_cmd, product_info): +def check_system_dep(distrib, check_cmd, product_info): """Search for system dependencies, check if installed + :param dist : The linux ditribution (CO7,DB10...) :param check_cmd Config: The command to use for checking (rpm/apt) :param product_info Config: The configuration specific to the product :rtype: two dictionnaries for runtime and compile time dependencies with text status @@ -1229,19 +1230,24 @@ def check_system_dep(check_cmd, product_info): runtime_dep={} build_dep={} if "system_info" in product_info: + if distrib in product_info.system_info: + sysinfo=product_info.system_info[distrib] + else: + sysinfo=product_info.system_info + if check_cmd[0]=="rpm": - if "rpm" in product_info.system_info: - for pkg in product_info.system_info.rpm: + if "rpm" in sysinfo: + for pkg in sysinfo.rpm: runtime_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg) - if "rpm_dev" in product_info.system_info: - for pkg in product_info.system_info.rpm_dev: + if "rpm_dev" in sysinfo: + for pkg in sysinfo.rpm_dev: build_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg) if check_cmd[0]=="apt": - if "apt" in product_info.system_info: - for pkg in product_info.system_info.apt: + if "apt" in sysinfo: + for pkg in sysinfo.apt: runtime_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg) - if "apt_dev" in product_info.system_info: - for pkg in product_info.system_info.apt_dev: + if "apt_dev" in sysinfo: + for pkg in sysinfo.apt_dev: build_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg) return runtime_dep,build_dep -- 2.39.2