logger.flush()
# Do nothing if the product is not compilable
- if ("properties" in p_info and "compilation" in p_info.properties and
- p_info.properties.compilation == "no"):
+ if ("properties" in p_info and
+ "compilation" in p_info.properties and
+ p_info.properties.compilation == "no"):
+
log_step(logger, header, "ignored")
logger.write("\n", 3, False)
continue
# Check if sources was already successfully installed
check_source = src.product.check_source(p_info)
if not check_source:
- logger.write(_("Sources of product not found (try 'sat -h prepare')\n"))
+ logger.write(_("Sources of product not found (try 'sat -h prepare') "))
res += 1 #BUG
continue
# Check if it was already successfully installed
if src.product.check_installation(p_info):
- logger.write(_("Already installed\n"))
+ logger.write(_("Already installed "))
continue
# If the show option was called, do not launch the compilation
if options.no_compile:
- logger.write(_("Not installed\n"))
+ logger.write(_("Not installed "))
continue
# Check if the dependencies are installed
import subprocess
import src
+import src.debug as DBG
parser = src.options.Options()
parser.add_option('p', 'products', 'list2', 'products',
import sys
import src
+import src.debug as DBG
+import pprint as PP
class Environ:
'''Class to manage the environment context
def __repr__(self):
"""easy non exhaustive quick resume for debug print
"""
- res={}
- res["environ"]=self.environ
- return self.__class__.__name__ + str(res)[0:-1] + " ...etc...}"
+ return "%s(\n%s\n)" % (self.__class__.__name__, PP.pformat(self.environ))
def _expandvars(self, value):
'''replace some $VARIABLE into its actual value in the environment
self.silent = False
def __repr__(self):
- """easy non exhaustive quick resume for debug print"""
- res={}
- res["environ"]=str(self.environ)
- res["forBuild"]=self.forBuild
- return self.__class__.__name__ + str(res)[0:-1] + " ...etc...}"
+ """easy almost exhaustive quick resume for debug print"""
+ res = {
+ "environ" : self.environ,
+ "forBuild" : self.forBuild,
+ "for_package" : self.for_package,
+ }
+ return "%s(\n%s\n)" % (self.__class__.__name__, PP.pformat(res))
def append(self, key, value, sep=os.pathsep):
'''append value to key using sep
:param logger Logger: The logger instance to display messages
"""
+ # add variable PRODUCT_ROOT_DIR as $workdir in APPLICATION.environ section if not present
+ 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 default Config.APPLICATION.environ.PRODUCT_ROOT_DIR", self.cfg.APPLICATION.environ)
+
# Set the variables defined in the "environ" section
if 'environ' in self.cfg.APPLICATION:
# we write PRODUCT environment it in order to conform to
:param logger Logger: The logger instance to display messages
"""
# set root dir
+ DBG.write("set_salome_minimal_product_env", product_info)
root_dir = product_info.name + "_ROOT_DIR"
if not self.is_defined(root_dir):
if 'install_dir' in product_info and product_info.install_dir:
:param logger Logger: The logger instance to display messages
:param env_info list: the list of products
"""
+ DBG.write("set_full_environ for", env_info)
+ # DBG.write("set_full_environ config", self.cfg.APPLICATION.environ, True)
# set product environ
self.set_application_env(logger)
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import os
+import pprint as PP
+import src.debug as DBG
bat_header="""@echo off
return ContextFileEnviron(output, environ)
raise Exception("FileEnviron: Unknown shell = %s" % shell)
-class FileEnviron:
+class FileEnviron(object):
"""Base class for shell environment
"""
def __init__(self, output, environ=None):
"""
self._do_init(output, environ)
+ def __repr__(self):
+ """easy non exhaustive quick resume for debug print"""
+ res = {
+ "output" : self.output,
+ "environ" : self.environ,
+ }
+ return "%s(\n%s\n)" % (self.__class__.__name__, PP.pformat(res))
+
+
def _do_init(self, output, environ=None):
"""Initialization
self.output = output
self.toclean = []
if environ is not None:
+ #if str(type(environ)) == "<type 'instance'>":
+ if id(environ) == id(os.environ):
+ DBG.tofix("set %s environ as python os.environ, are you sure it is safe ?" % self.__class__.__name__, True)
self.environ = environ
else:
- self.environ = os.environ
+ DBG.tofix("set %s environ as COPY of python os.environ, are you sure it is safe ?" % self.__class__.__name__, True)
+ self.environ = dict(os.environ) #make a copy cvw 180320
def add_line(self, number):
"""Add some empty lines in the shell file