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")
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())
# 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:
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
"""
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}
###########################################################################
"""
# 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':
# 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':