Salome HOME
sat #32534 : warning if the application is used on a not supported platform, and... sept_22
authorcrouzet <nicolas.crouzet@cea.fr>
Thu, 13 Oct 2022 07:54:43 +0000 (09:54 +0200)
committercrouzet <nicolas.crouzet@cea.fr>
Thu, 13 Oct 2022 08:01:36 +0000 (10:01 +0200)
Save git repositories for vcs products, even if archive is not in VCS mode
The user of the archive will be able to switch to VCS mode by changing the get_source flag

commands/compile.py
commands/package.py
commands/prepare.py
src/__init__.py

index 043706be41529c8466792418f64aa34b88a63b1c..af2d2745717595dd9d9423aa9afcc527a0a3c3c4 100644 (file)
@@ -720,6 +720,9 @@ def run(args, runner, logger):
     # check that the command has been called with an application
     src.check_config_has_application( runner.cfg )
 
+    # write warning if platform is not declared as supported
+    src.check_platform_is_supported( runner.cfg, logger )
+
     # Print some informations
     logger.write(_('Executing the compile commands in the build '
                                 'directories of the products of '
index b619ec19d80b8452de3e4ac24baff3fbdf13f906..fd5bba7efc07a377ac97c64d3f8b0a7e493d4aea 100644 (file)
@@ -1318,7 +1318,9 @@ def find_product_scripts_and_pyconf(p_name,
                     product_pyconf_cfg[section].archive_info.archive_name =\
                         p_info.name + ".tgz"
     
-    if (with_vcs) and src.product.product_is_vcs(p_info):
+    # save git repositories for vcs products, even if archive is not in VCS mode
+    # in this case the user will be able to change get_source flag and work with git
+    if src.product.product_is_vcs(p_info):
         # in vcs mode we must replace explicitely the git server url
         # (or it will not be found later because project files are not exported in archives)
         for section in product_pyconf_cfg:
index 66f77e0606c7a09372af5295fe17f6a5deef33b2..71a44a805b935d1dac409f7f2f6256675dd37a09 100644 (file)
@@ -88,6 +88,9 @@ def run(args, runner, logger):
     # check that the command has been called with an application
     src.check_config_has_application( runner.cfg )
 
+    # write warning if platform is not declared as supported
+    src.check_platform_is_supported( runner.cfg, logger )
+
     products_infos = src.product.get_products_list(options, runner.cfg, logger)
 
     # Construct the arguments to pass to the clean, source and patch commands
index 9a4a846ed54b7d8bce23b4609cd9e062f45a2cc0..2a1f8f0a43e5dfca967f8bcee1e7d41305ef78c5 100644 (file)
@@ -82,6 +82,17 @@ def check_config_has_application( config, details = None ):
             details.append(message)
         raise SatException( message )
 
+def check_platform_is_supported( config, logger ):
+    """check that the platform is supported, write warning if not.
+    
+    :param config class 'common.pyconf.Config': The config.
+    """
+    if 'platform' in config.APPLICATION and config.VARS.dist not in config.APPLICATION.platform:
+        msg = "WARNING: Your application configuration is not supported on this platform (%s)\n"\
+              "         Please consider using the native application!" % config.VARS.dist
+        logger.write("\n%s\n\n" % printcolors.printcWarning(msg), 1)
+    return
+
 def check_config_has_profile( config, details = None ):
     """\
     check that the config has the key APPLICATION.profile.