Salome HOME
Fix commit 1d03556: salome scripts must be copied, not add as symlinks
authorGilles DAVID <gilles-g.david@edf.fr>
Fri, 17 Mar 2023 14:50:18 +0000 (15:50 +0100)
committerGilles DAVID <gilles-g.david@edf.fr>
Fri, 17 Mar 2023 14:50:18 +0000 (15:50 +0100)
bin/appli_gen.py

index 269573403290573ea7c11368138a966a1289bfc8..f6345e339d23ecc90a12ad1011cd85c8637bab18 100755 (executable)
@@ -283,9 +283,6 @@ def install(prefix, config_file, verbose=0):
                'runRemote.sh',
                'runRemoteSSL.sh',
                '.salome_run',
-               'salome',
-               'salome_mesa',
-               'salome_common.py',
                'update_catalogs.py',
                '.bashrc',
                ):
@@ -313,6 +310,19 @@ def install(prefix, config_file, verbose=0):
             fd.write('#!/bin/bash\n')
             fd.write('module load %s\n' % (' '.join(env_modules)))
 
+    # Copy salome / salome_mesa scripts:
+
+    for scripts in ('salome', 'salome_mesa', 'salome_common.py'):
+        salome_script = open(os.path.join(appliskel_dir, scripts)).read()
+        salome_file = os.path.join(home_dir, scripts)
+        try:
+            os.remove(salome_file)
+        except Exception:
+            pass
+        with open(salome_file, 'w') as fd:
+            fd.write(salome_script.replace('MODULES = []', 'MODULES = {}'.format(env_modules)))
+            os.chmod(salome_file, 0o755)
+
     # Add .salome-completion.sh file
     shutil.copyfile(os.path.join(appliskel_dir, ".salome-completion.sh"),
                     os.path.join(home_dir, ".salome-completion.sh"))