From: crouzet Date: Fri, 7 Feb 2020 14:18:08 +0000 (+0100) Subject: check system products dependencies before compiling + check openssl when piping X-Git-Tag: 5.6.0~23^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e2980276043ab94b873e8e582d5b3707051a8670;p=tools%2Fsat.git check system products dependencies before compiling + check openssl when piping --- diff --git a/commands/compile.py b/commands/compile.py index e0a1f99..15a8425 100644 --- a/commands/compile.py +++ b/commands/compile.py @@ -420,6 +420,11 @@ def compile_product_pip(sat, :return: 1 if it fails, else 0. :rtype: int ''' + # pip needs openssl-dev. If openssl is declared in the application, we check it! + if "openssl" in config.APPLICATION.products: + openssl_cfg = src.product.get_product_config(config, "openssl") + if not src.product.check_installation(config, openssl_cfg): + raise src.SatException(_("please install system openssl development package, it is required for products managed by pip.")) # a) initialisation p_name, p_info = p_name_info res = 0 diff --git a/src/product.py b/src/product.py index d38241a..5994095 100644 --- a/src/product.py +++ b/src/product.py @@ -829,10 +829,29 @@ def check_installation(config, product_info): :return: True if it is well installed :rtype: boolean """ - # don't check native products, or products that are not compiled - if (not product_compiles(product_info)) or product_is_native(product_info): + # don't check products that are not compiled + if not product_compiles(product_info): return True + if product_is_native(product_info): + # check a system product + check_cmd=src.system.get_pkg_check_cmd() + run_pkg,build_pkg=src.product.check_system_dep(check_cmd, product_info) + build_dep_ko=[] + for pkg in build_pkg: + if "KO" in build_pkg[pkg]: + build_dep_ko.append(pkg) + if build_dep_ko: + # the product is not installed : display message and return error status + msg="Please install them with %s before compiling salome" % check_cmd[0] + print("\nmissing compile time dependencies : ") + for md in build_dep_ko: + print(md) + print(msg) + return False + else: + return True + install_dir = product_info.install_dir if ( (src.appli_test_property(config,"single_install_dir", "yes") and src.product.product_test_property(product_info,"single_install_dir", "yes")) or