From: crouzet Date: Fri, 21 Jul 2017 13:41:25 +0000 (+0200) Subject: bug fhs pour bin, et generation automatique du fichier cfg X-Git-Tag: 5.0.0b2~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e5fd1cbf475a71d610ecf30d5568f1e55d938c99;p=tools%2Fsat.git bug fhs pour bin, et generation automatique du fichier cfg --- diff --git a/commands/application.py b/commands/application.py index 783fac4..55d2d30 100644 --- a/commands/application.py +++ b/commands/application.py @@ -263,6 +263,16 @@ def generate_launch_file(config, appli_dir, catalog, logger, l_SALOME_modules): write_step(logger, _("Creating environment files")) status = src.KO_STATUS + + VersionSalome = src.get_salome_version(config) + if VersionSalome>=820: + # for salome 8+ we use a salome context file for the virtual app + app_shell="cfg" + env_ext="cfg" + else: + app_shell="bash" + env_ext="sh" + try: import environ # generate only shells the user wants (by default bash, csh, batch) @@ -270,16 +280,14 @@ def generate_launch_file(config, appli_dir, catalog, logger, l_SALOME_modules): # with the current system. environ.write_all_source_files(config, logger, + shells=[app_shell], silent=True) status = src.OK_STATUS finally: logger.write(src.printcolors.printc(status) + "\n", 2, False) # build the application (the name depends upon salome version - # for salome 8 we use a salome context file - VersionSalome = src.get_salome_version(config) - env_ext="cfg" if VersionSalome>=820 else "sh" - env_file = os.path.join(config.APPLICATION.workdir, "env_launch.cfg") + env_file = os.path.join(config.APPLICATION.workdir, "env_launch." + env_ext) write_step(logger, _("Building application"), level=2) cf = create_config_file(config, l_SALOME_modules, env_file, logger) diff --git a/commands/test.py b/commands/test.py index bf89e54..80b224c 100644 --- a/commands/test.py +++ b/commands/test.py @@ -544,6 +544,7 @@ def run(args, runner, logger): ''' (options, args) = parse_option(args, runner.cfg) + # the test base is specified either by the application, or by the --base option with_application = False if runner.cfg.VARS.application != 'None': logger.write(_('Running tests on application %s\n') % @@ -554,6 +555,7 @@ def run(args, runner, logger): raise src.SatException(_('A test base is required. Use the --base ' 'option')) + # the launcher is specified either by the application, or by the --launcher option if with_application: # check if environment is loaded if 'KERNEL_ROOT_DIR' in os.environ: diff --git a/src/environment.py b/src/environment.py index e397b99..d61eb52 100644 --- a/src/environment.py +++ b/src/environment.py @@ -404,15 +404,16 @@ class SalomeEnviron: lib_path = os.path.join(envcompo_root_dir, 'lib', 'salome') l_binpath_libpath.append( (bin_path, lib_path) ) - bin_path = os.path.join(env_root_dir, 'bin', 'salome') if src.get_property_in_product_cfg(pi, "fhs"): lib_path = os.path.join(env_root_dir, 'lib') pylib1_path = os.path.join(env_root_dir, self.python_lib0) pylib2_path = os.path.join(env_root_dir, self.python_lib1) + bin_path = os.path.join(env_root_dir, 'bin') else: lib_path = os.path.join(env_root_dir, 'lib', 'salome') pylib1_path = os.path.join(env_root_dir, self.python_lib0, 'salome') pylib2_path = os.path.join(env_root_dir, self.python_lib1, 'salome') + bin_path = os.path.join(env_root_dir, 'bin', 'salome') # Construct the paths to prepend to PATH and LD_LIBRARY_PATH and # PYTHONPATH