From: Gilles DAVID Date: Fri, 17 Mar 2023 14:50:18 +0000 (+0100) Subject: Fix commit 1d03556: salome scripts must be copied, not add as symlinks X-Git-Tag: emc2p_1.3.7-rc1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c5b9a3f6a5567d813b2304b8caed8e940d04b9dc;p=modules%2Fkernel.git Fix commit 1d03556: salome scripts must be copied, not add as symlinks --- diff --git a/bin/appli_gen.py b/bin/appli_gen.py index 269573403..f6345e339 100755 --- a/bin/appli_gen.py +++ b/bin/appli_gen.py @@ -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"))