From: Nabil Ghodbane Date: Tue, 3 Sep 2019 11:51:03 +0000 (+0200) Subject: variable environnement out_dir_Path selon OS X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0da1ffb51b0b145b858746f46141b6375fa340e3;p=tools%2Fsat.git variable environnement out_dir_Path selon OS --- diff --git a/commands/package.py b/commands/package.py index 68817fb..0a1c84a 100644 --- a/commands/package.py +++ b/commands/package.py @@ -256,7 +256,7 @@ def produce_relative_launcher(config, # Little hack to put out_dir_Path outside the strings src.replace_in_file(filepath, 'r"out_dir_Path', 'out_dir_Path + r"' ) - + # A hack to put a call to a file for distene licence. # It does nothing to an application that has no distene product if distene_licence_file_name: @@ -356,7 +356,10 @@ def produce_relative_env_files(config, for_package = binaries_dir_name) # Little hack to put out_dir_Path as environment variable - src.replace_in_file(filepath, '"out_dir_Path', '"${out_dir_Path}' ) + if src.architecture.is_windows(): + src.replace_in_file(filepath, '"out_dir_Path', '"%out_dir_Path%' ) + else: + src.replace_in_file(filepath, '"out_dir_Path', '"${out_dir_Path}' ) # change the rights in order to make the file executable for everybody os.chmod(filepath, diff --git a/src/environment.py b/src/environment.py index 20a5c1e..d32a7cf 100644 --- a/src/environment.py +++ b/src/environment.py @@ -428,6 +428,12 @@ class SalomeEnviron: :param product_info Config: The product description :param logger Logger: The logger instance to display messages """ + + if src.architecture.is_windows(): + out_dir_Path = "%out_dir_Path%" + else: + out_dir_Path = "out_dir_Path" + # set root dir DBG.write("set_salome_minimal_product_env", product_info) root_dir = product_info.name + "_ROOT_DIR" @@ -448,7 +454,7 @@ class SalomeEnviron: if not self.for_package: self.set(src_dir, product_info.source_dir) else: - self.set(src_dir, os.path.join("out_dir_Path", + self.set(src_dir, os.path.join(out_dir_Path, "SOURCES", product_info.name)) @@ -589,6 +595,11 @@ class SalomeEnviron: :param logger Logger: The logger instance to display messages """ + if src.architecture.is_windows(): + out_dir_Path = "%out_dir_Path%" + else: + out_dir_Path = "out_dir_Path" + # Get the informations corresponding to the product pi = src.product.get_product_config(self.cfg, product) @@ -612,7 +623,7 @@ class SalomeEnviron: if self.for_package: - pi.install_dir = os.path.join("out_dir_Path", + pi.install_dir = os.path.join(out_dir_Path, self.for_package, pi.name)