From: Serge Rehbinder Date: Wed, 25 Jan 2017 14:31:28 +0000 (+0100) Subject: sat package: add option without_commercial X-Git-Tag: 5.0.0a1~38^2~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2aea92170bc2094587f594c3b05e725426329b8f;p=tools%2Fsat.git sat package: add option without_commercial --- diff --git a/commands/package.py b/commands/package.py index be3a01a..6ae96f8 100644 --- a/commands/package.py +++ b/commands/package.py @@ -97,6 +97,8 @@ parser.add_option('n', 'name', 'string', 'name', _('Optional: The name or full path of the archive.'), None) parser.add_option('', 'add_files', 'list2', 'add_files', _('Optional: The list of additional files to add to the archive.'), []) +parser.add_option('', 'without_commercial', 'boolean', 'with_commercial', + _('Optional: do not add commercial licence.'), False) def add_files(tar, name_archive, d_content, logger): '''Create an archive containing all directories and files that are given in @@ -140,7 +142,8 @@ def produce_relative_launcher(config, logger, file_dir, file_name, - binaries_dir_name): + binaries_dir_name, + with_commercial=True): '''Create a specific SALOME launcher for the binary package. This launcher uses relative paths. @@ -179,7 +182,9 @@ def produce_relative_launcher(config, launch_file = open(filepath, "w") launch_file.write(before) # Write - writer.write_cfgForPy_file(launch_file, for_package = binaries_dir_name) + writer.write_cfgForPy_file(launch_file, + for_package = binaries_dir_name, + with_commercial=with_commercial) launch_file.write(after) launch_file.close() @@ -305,10 +310,11 @@ def binary_package(config, logger, options, tmp_working_dir): if "profile" in config.APPLICATION: launcher_name = config.APPLICATION.profile.launcher_name launcher_package = produce_relative_launcher(config, - logger, - tmp_working_dir, - launcher_name, - binaries_dir_name) + logger, + tmp_working_dir, + launcher_name, + binaries_dir_name, + not(options.without_commercial)) d_products["launcher"] = (launcher_package, launcher_name) else: diff --git a/src/environment.py b/src/environment.py index f74d761..0634ec5 100644 --- a/src/environment.py +++ b/src/environment.py @@ -167,7 +167,12 @@ class SalomeEnviron: """Class to manage the environment of SALOME. """ - def __init__(self, cfg, environ, forBuild=False, for_package=None): + def __init__(self, + cfg, + environ, + forBuild=False, + for_package=None, + enable_simple_env_script = True): '''Initialization. :param cfg Config: the global config @@ -182,6 +187,7 @@ class SalomeEnviron: self.cfg = cfg self.forBuild = forBuild self.for_package = for_package + self.enable_simple_env_script = enable_simple_env_script self.silent = False def __repr__(self): @@ -630,6 +636,8 @@ class SalomeEnviron: :param script_path str: a path to an environment script :param logger Logger: The logger instance to display messages """ + if not self.enable_simple_env_script: + return # Check that the script exists if not os.path.exists(script_path): raise src.SatException(_("Environment script not found: %s") % @@ -768,7 +776,8 @@ class FileEnvWriter: def write_cfgForPy_file(self, filename, additional_env = {}, - for_package = None): + for_package = None, + with_commercial = True): """Append to current opened aFile a cfgForPy environment (SALOME python launcher). @@ -790,7 +799,8 @@ class FileEnvWriter: env = SalomeEnviron(self.config, tmp, forBuild=False, - for_package=for_package) + for_package=for_package, + enable_simple_env_script = with_commercial) env.silent = self.silent if self.env_info is not None: