]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
check system products dependencies before compiling + check openssl when piping
authorcrouzet <nicolas.crouzet@cea.fr>
Fri, 7 Feb 2020 14:18:08 +0000 (15:18 +0100)
committercrouzet <nicolas.crouzet@cea.fr>
Fri, 7 Feb 2020 14:18:08 +0000 (15:18 +0100)
commands/compile.py
src/product.py

index e0a1f99b5d786e24cff4916e47653333b5ec628c..15a84250dd2e5202611e9b1b2fec4dd6e966acdb 100644 (file)
@@ -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
index d38241a3f8f19cc83eef8e6a89b9fdc0f6923d22..59940956e881e671ad34ab66aad044e782993bf0 100644 (file)
@@ -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