Salome HOME
Merge branch 'nct/jan21' of https://codev-tuleap.cea.fr/plugins/git/salome/sat into...
[tools/sat.git] / commands / source.py
index 54bd9f0f07802309eeb8f7e9026269b4e68ee3d9..47d8d15612d9e8e6a9b27b982a95a27fc940d39f 100644 (file)
@@ -102,7 +102,7 @@ def get_source_from_git(config,
         repo_git = product_info.git_info.repo_dev    
     else:
         repo_git = product_info.git_info.repo    
-        
+
 
     # Display informations
     logger.write('%s:%s' % (coflag, src.printcolors.printcInfo(repo_git)), 3, 
@@ -117,6 +117,9 @@ def get_source_from_git(config,
     logger.flush()
     logger.write('\n', 5, False)
 
+    git_options= ''
+    if is_dev and "git_options" in product_info.git_info:
+        git_options = product_info.git_info.git_options
     sub_dir = None
 
     # what do we do with git tree structure and history
@@ -130,13 +133,13 @@ def get_source_from_git(config,
     if sub_dir  is None:
       # Call the system function that do the extraction in git mode
       retcode = src.system.git_extract(repo_git,
-                                   product_info.git_info.tag,
+                                   product_info.git_info.tag,git_options,
                                    source_dir, logger, environ)
     else:
       # Call the system function that do the extraction of a sub_dir in git mode
       logger.write("sub_dir:%s " % sub_dir, 3)
       retcode = src.system.git_extract_sub_dir(repo_git,
-                                   product_info.git_info.tag,
+                                   product_info.git_info.tag,git_options,
                                    source_dir, sub_dir, logger, environ)
 
 
@@ -158,16 +161,9 @@ def get_source_from_archive(config, product_info, source_dir, logger):
     # check if pip should be used : pip mode id activated if the application and product have pip property
     if (src.appli_test_property(config,"pip", "yes") and 
        src.product.product_test_property(product_info,"pip", "yes")):
-        # download whl in local archive dir
-        pip_download_cmd="pip download --disable-pip-version-check --destination-directory %s --no-deps %s==%s " %\
-                         (config.LOCAL.archive_dir, product_info.name, product_info.version)
-        logger.write(pip_download_cmd, 3, False) 
-        res_pip = (subprocess.call(pip_download_cmd, 
-                                   shell=True, 
-                                   cwd=config.LOCAL.workdir,
-                                   stdout=logger.logTxtFile, 
-                                   stderr=subprocess.STDOUT) == 0)        
-        return res_pip
+        pip_msg = "PIP : do nothing, product will be downloaded later at compile time "
+        logger.write(pip_msg, 3) 
+        return True
 
     # check archive exists
     if not os.path.exists(product_info.archive_info.archive_name):
@@ -406,14 +402,23 @@ def get_product_sources(config,
                                     env_appli)
 
     if product_info.get_source == "native":
-        # skip
-        logger.write('%s  ' % src.printcolors.printc(src.OK_STATUS),
-                     3,
-                     False)
-        msg = _('INFORMATION : Not doing anything because the product'
-                ' is of type "native".\n')
-        logger.write(msg, 3)
-        return True        
+        # 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)
+        result=True
+        for pkg in run_pkg:
+            logger.write(" - "+pkg + " : " + run_pkg[pkg], 1)
+            if "KO" in run_pkg[pkg]:
+                result=False
+        for pkg in build_pkg:
+            logger.write(" - "+pkg + " : " + build_pkg[pkg], 1)
+            if "KO" in build_pkg[pkg]:
+                result=False
+        if result==False:
+            logger.error("some system dependencies are missing, please install them with "+\
+                         check_cmd[0])
+        return result        
 
     if product_info.get_source == "fixed":
         # skip