]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
specialisation des paquets systemes par distribution, pour mieux gerer les differences
authorcrouzet <nicolas.crouzet@cea.fr>
Fri, 7 May 2021 14:37:31 +0000 (16:37 +0200)
committercrouzet <nicolas.crouzet@cea.fr>
Fri, 7 May 2021 14:37:31 +0000 (16:37 +0200)
commands/config.py
commands/source.py
src/product.py

index 6ef3dbff7dce1326f5c8b457c376dad81a44d3f3..e855c5765068683ac52dce3b1317eca1f6e9a7b9 100644 (file)
@@ -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)
index 47d8d15612d9e8e6a9b27b982a95a27fc940d39f..d92ddc59d729895e0f0e6fe0cdee666f503337f8 100644 (file)
@@ -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)
index 5bb0c16153a09b983554f4dc9029d2ae45c0fdc2..bbeeffa119f3d629535a7d24f2aa7fc4cd546b9c 100644 (file)
@@ -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