From: crouzet Date: Fri, 8 Feb 2019 14:21:28 +0000 (+0100) Subject: nettoyage de la gestion de out_dir_Path et PRODUCT_ROOT_DIR X-Git-Tag: 5.3.0~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dd1ed832b516b72b6022734fbf1aacd93906c72c;p=tools%2Fsat.git nettoyage de la gestion de out_dir_Path et PRODUCT_ROOT_DIR --- diff --git a/src/environment.py b/src/environment.py index ed79706..d342e86 100644 --- a/src/environment.py +++ b/src/environment.py @@ -383,23 +383,18 @@ class SalomeEnviron: lProdName.append(ProdName) return lProdName - def set_application_env(self, logger, no_PRODUCT_ROOT_DIR=False): + def set_application_env(self, logger): """\ Sets the environment defined in the APPLICATION file. :param logger Logger: The logger instance to display messages """ - # add variable PRODUCT_ROOT_DIR as $workdir in APPLICATION.environ section if not present - # but if sat launcher or sat package do not duplicate line context.setVariable(r"PRODUCT_ROOT_DIR", ... - # no_PRODUCT_ROOT_DIR used only for write_cfgForPy_file - if not no_PRODUCT_ROOT_DIR: # do not duplicate context.setVariable(r"PRODUCT_ROOT_DIR" - try: - tmp = self.cfg.APPLICATION.environ.PRODUCT_ROOT_DIR - except: - self.cfg.APPLICATION.environ.PRODUCT_ROOT_DIR = src.pyconf.Reference(self.cfg, src.pyconf.DOLLAR, "workdir") - DBG.write("set_application_env: add APPLICATION.environ.PRODUCT_ROOT_DIR", self.cfg.APPLICATION.environ) - + if self.for_package: + self.set("PRODUCT_ROOT_DIR", "out_dir_Path") + else: + self.cfg.APPLICATION.environ.PRODUCT_ROOT_DIR = src.pyconf.Reference(self.cfg, src.pyconf.DOLLAR, "workdir") + # these sensitive variables are reset to avoid bad environment interactions self.add_line(1) self.add_comment("reset these sensitive variables to avoid bad environment interactions") @@ -913,7 +908,7 @@ class FileEnvWriter: else: # set env from PRODUCT - env.set_application_env(self.logger, no_PRODUCT_ROOT_DIR=True) + env.set_application_env(self.logger) # The list of products to launch lProductsName = env.get_names(self.config.APPLICATION.products.keys()) @@ -921,7 +916,6 @@ class FileEnvWriter: # set the products env.set_products(self.logger, src_root=self.src_root) - DBG.write("set_application_env without PRODUCT_ROOT_DIR", self.config.APPLICATION.environ) # Add the additional environment if it is not empty if len(additional_env) != 0: diff --git a/src/fileEnviron.py b/src/fileEnviron.py index fa45497..ab79916 100644 --- a/src/fileEnviron.py +++ b/src/fileEnviron.py @@ -25,9 +25,6 @@ bat_header="""\ rem The following variables are used only in case of a sat package set out_dir_Path=%~dp0 -set PRODUCT_OUT_DIR=%out_dir_Path% -set prereq_install_Path=%out_dir_Path%\PREREQUISITES\INSTALL -set prereq_build_Path=%out_dir_Path%\PREREQUISITES\BUILD """ @@ -70,10 +67,8 @@ out_var=`cleandup $xenv $2` export $1=$out_var } -# The 3 following variables are used only in case of a sat package +# This line is used only in case of a sat package export out_dir_Path=$(cd $(dirname ${BASH_SOURCE[0]});pwd) -export PRODUCT_OUT_DIR=${out_dir_Path} -export PRODUCT_ROOT_DIR=${PRODUCT_OUT_DIR} ########################################################################### """ @@ -851,7 +846,6 @@ def main(args): # Logger level error context.getLogger().setLevel(40) - context.setVariable(r"PRODUCT_ROOT_DIR", out_dir_Path, overwrite=True) # here your local standalone environment if len(args) >1 and args[0]=='doc': @@ -978,7 +972,6 @@ def main(args): # Logger level error context.getLogger().setLevel(40) - context.setVariable(r"PRODUCT_ROOT_DIR", out_dir_Path, overwrite=True) # here your local standalone environment if len(args) >1 and args[0]=='doc':