]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
Merge branch 'sept_22'
authorcrouzet <nicolas.crouzet@cea.fr>
Thu, 13 Oct 2022 08:12:13 +0000 (10:12 +0200)
committercrouzet <nicolas.crouzet@cea.fr>
Thu, 13 Oct 2022 08:12:13 +0000 (10:12 +0200)
commands/compile.py
commands/package.py
commands/prepare.py
data/templates/PythonComponent/CMakeLists.txt
data/templates/PythonComponent/resources/CMakeLists.txt
src/__init__.py
src/fileEnviron.py
src/internal_config/README_BIN.template
src/internal_config/README_SRC.template

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 1911d0036a144b5d02fe52dc4362861cc277f2ca..8f592b9e541cdefee3a41e55bd0f5684608070b2 100644 (file)
@@ -99,11 +99,7 @@ ENDIF(EXISTS ${GUI_ROOT_DIR})
 ## From GUI:
 ##
 # Qt
-IF(NOT SALOME_GUI_BUILD_WITH_QT5)
-  FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
-ELSE()
-  FIND_PACKAGE(SalomeQt5 REQUIRED)
-ENDIF()
+FIND_PACKAGE(SalomeQt5 REQUIRED)
 
 # Detection summary:
 SALOME_PACKAGE_REPORT_AND_CHECK()
index 6ae660cd29f3a5049a4fd3308dc2a75be629c572..85bd5cadde0cd101408ccc2174d5a1d1318ece18 100644 (file)
@@ -29,3 +29,4 @@ SET(Others_RESOURCES
 )
 
 INSTALL(FILES ${Others_RESOURCES} DESTINATION ${SALOME_:sat:{PYCMP}_INSTALL_RES_DATA})
+INSTALL(FILES SalomeApp.xml RENAME SalomeAppSL.xml DESTINATION ${SALOME_:sat:{PYCMP}_INSTALL_RES_DATA})
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.
index 5afc9e76124cff524c1a78bc82f175d44c069ec8..dbf0938545537fbe2e056f8434032a343a34c19e 100644 (file)
@@ -489,6 +489,10 @@ class LauncherFileEnviron(FileEnviron):
         if not self.environ.is_defined("PATH"):
             self.environ.set("PATH","")
 
+        if self.init_path:
+            self.output.write('\n'+self.indent)
+            self.add_echo("Modifier cette variable pour ne pas réinitialiser les PATHS")
+            self.output.write(self.indent+'reinitialise_paths=True\n\n')
 
     def add_echo(self, text):
         """Add a comment
@@ -518,23 +522,28 @@ class LauncherFileEnviron(FileEnviron):
         if separator in value:
             raise Exception(msg % (key, value, separator))
 
-        if (self.init_path and (not self.environ.is_defined(key))):
+        is_key_defined=self.environ.is_defined(key)
+        conditional_reinit=False
+        if (self.init_path and (not is_key_defined)):
             # reinitialisation mode set to true (the default)
             # for the first occurrence of key, we set it.
             # therefore key will not be inherited from environment
+            self.output.write(self.indent+'if reinitialise_paths:\n'+self.indent)
             self.set(key, value)
-            return
+            self.output.write(self.indent+'else:\n'+self.indent)
+            conditional_reinit=True # in this case do not register value in self.environ a second time
 
         # in all other cases we use append (except if value is already the key
         do_append=True
-        if self.environ.is_defined(key):
+        if is_key_defined:
             value_list = self.environ.get(key).split(sep)
             # rem : value cannot be expanded (unlike bash/bat case) - but it doesn't matter.
             if value in value_list:
                 do_append=False  # value is already in key path : we don't append it again
             
         if do_append:
-            self.environ.append_value(key, value,sep) # register value in self.environ
+            if not conditional_reinit:
+                self.environ.append_value(key, value,sep) # register value in self.environ
             if key in self.specialKeys.keys():
                 #for these special keys we use the specific salomeContext function
                 self.output.write(self.begin+'addTo%s(r"%s")\n' % 
@@ -571,22 +580,28 @@ class LauncherFileEnviron(FileEnviron):
         if separator in value:
             raise Exception(msg % (key, value, separator))
 
-        if (self.init_path and (not self.environ.is_defined(key))):
+        is_key_defined=self.environ.is_defined(key)
+        conditional_reinit=False
+        if (self.init_path and (not is_key_defined)):
             # reinitialisation mode set to true (the default)
             # for the first occurrence of key, we set it.
             # therefore key will not be inherited from environment
+            self.output.write(self.indent+'if reinitialise_paths:\n'+self.indent)
             self.set(key, value)
-            return
+            self.output.write(self.indent+'else:\n'+self.indent)
+            conditional_reinit=True # in this case do not register value in self.environ a second time
+
         # in all other cases we use append (except if value is already the key
         do_append=True
-        if self.environ.is_defined(key):
+        if is_key_defined:
             value_list = self.environ.get(key).split(sep)
             # rem : value cannot be expanded (unlike bash/bat case) - but it doesn't matter.
             if value in value_list:
                 do_append=False  # value is already in key path : we don't append it again
             
         if do_append:
-            self.environ.append_value(key, value,sep) # register value in self.environ
+            if not conditional_reinit:
+                self.environ.append_value(key, value,sep) # register value in self.environ
             if key in self.specialKeys.keys():
                 #for these special keys we use the specific salomeContext function
                 self.output.write(self.begin+'addTo%s(r"%s")\n' % 
index ae3962fc14d80c20fcc3c436bac53fb23db57473..48a2a657830a731571ee2cd2ef6cbeff34e215aa 100644 (file)
@@ -9,6 +9,6 @@ Warning : This binary installation depends upon some native ¤{operatingSystem}
 If some of these packages are missing on your system, the execution may fail. 
 If this is the case, please install the missing ones with your ¤{operatingSystem} package manager.
 Note that you can use sat to check if the native prerequisites are installed on your system. The command is : 
-    ${ROOT}/sat config  ¤{application} --check_system
+    ${ROOT}/sat/sat config  ¤{application} --check_system
 
 
index 659fd9a2f281e1f7838a2244b86c02799e5e0e3c..014f63db4aad9e0a199e7aef161aa145baa9e0ee 100644 (file)
@@ -11,7 +11,7 @@ This version is configured to work with the application of the package.
 
 sat is located in $ROOT and you can read its documentation in 
 $ROOT/sat/doc or by using:
-> $ROOT/sat --help
+> $ROOT/sat/sat --help
 
 If you use bash, you can have completion for sat by sourcing $ROOT/sat/complete_sat.sh:
 > source $ROOT/sat/complete_sat.sh
@@ -20,7 +20,7 @@ If you use bash, you can have completion for sat by sourcing $ROOT/sat/complete_
 a) Preparing the sources of your application
 ============================================
 Type the following command to get the source and apply the patches:
-> $ROOT/sat prepare ¤{application}
+> $ROOT/sat/sat prepare ¤{application}
 
 The sources are retrieved from tgz archives located in ARCHIVES directory (or from VCS tools 
 if they were included)
@@ -29,7 +29,7 @@ if they were included)
 b) Build ¤{application}
 =======================
 Type the following command to compile and install the products of your application:
-> $ROOT/sat -t compile ¤{application}
+> $ROOT/sat/sat -t compile ¤{application}
 
 The -t option displays the compilation logs in the terminal.
 
@@ -51,14 +51,14 @@ In this case please refer to the instructions after
 c) Set environment for libraries inside ¤{application}
 ======================================================
 Type the following command to produce the environment files:
-> $ROOT/sat environ ¤{application}
+> $ROOT/sat/sat environ ¤{application}
 
 
 d) Create a SALOME launcher
 ===========================
 
 Create the launcher:
-> $ROOT/sat launcher ¤{application}
+> $ROOT/sat/sat launcher ¤{application}
 
 IMPORTANT : 
 If your package already contains a binary installation