X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fenvironment.py;h=7bf1ec6f5ef67b4229ab5a3e3480a5aa7079755f;hb=f1ebdf28aee780d266f03407fc39f766274b26f1;hp=875c4a5035d95bc6133488da3ec3ec4ed61b5144;hpb=a89eafdc38170b5901d3ce60664c5c37214160a7;p=tools%2Fsat.git diff --git a/src/environment.py b/src/environment.py index 875c4a5..7bf1ec6 100644 --- a/src/environment.py +++ b/src/environment.py @@ -229,11 +229,11 @@ class SalomeEnviron: return "%s(\n%s\n)" % (self.__class__.__name__, PP.pformat(res)) def __set_sorted_products_list(self): - from compile import get_dependencies_graph, depth_first_topo_graph all_products_infos = src.product.get_products_infos( self.cfg.APPLICATION.products, self.cfg) + from compile import get_dependencies_graph,depth_first_topo_graph all_products_graph=get_dependencies_graph(all_products_infos, self.forBuild) visited_nodes=[] sorted_nodes=[] @@ -245,6 +245,7 @@ class SalomeEnviron: visited_nodes, sorted_nodes) self.sorted_product_list=sorted_nodes + self.all_products_graph=all_products_graph def append(self, key, value, sep=os.pathsep): @@ -320,7 +321,7 @@ class SalomeEnviron: for k in self.environ.environ.keys(): try: value = self.get(k) - except: + except Exception: value = "?" out.write("%s=%s\n" % (k, value)) @@ -410,10 +411,20 @@ class SalomeEnviron: :param product_info Config: The product description :param logger Logger: The logger instance to display messages """ - # set root dir DBG.write("set_salome_minimal_product_env", product_info) + + # set root dir root_dir = product_info.name + "_ROOT_DIR" - if 'install_dir' in product_info and product_info.install_dir: + + if src.product.product_is_configuration(product_info): + # configuration modules are not installed, root_dir points at source dir + if not self.for_package: + self.set(root_dir, product_info.source_dir) + else: + self.set(root_dir, os.path.join("out_dir_Path", + "SOURCES", + os.path.basename(product_info.source_dir))) + elif 'install_dir' in product_info and product_info.install_dir: self.set(root_dir, product_info.install_dir) elif not self.silent: logger.write(" " + _("No install_dir for product %s\n") % @@ -446,6 +457,10 @@ class SalomeEnviron: :param pi Config: The product description """ + if src.product.product_is_configuration(pi): + # configuration modules are not installed and should not be set like others + return + # Construct XXX_ROOT_DIR env_root_dir = self.get(pi.name + "_ROOT_DIR") l_binpath_libpath = [] @@ -578,6 +593,10 @@ class SalomeEnviron: if not self.forBuild: if src.product.product_is_compile_time(pi): return + else: + if src.product.product_is_native(pi) : + self.set("SAT_%s_IS_NATIVE"%pi.name, "1") + # skip pip products when pip is activated and installation is done in python #if (src.appli_test_property(self.cfg,"pip", "yes") and @@ -585,6 +604,12 @@ class SalomeEnviron: # src.appli_test_property(self.cfg,"pip_install_dir", "python") ): # return + # skip product if git server does not host all git repositories + git_server= src.get_git_server(self.cfg, logger) + if src.product.product_is_not_opensource(pi) and not src.git_server_has_all_repositories( self.cfg, git_server): + logger.warning("%s is a closed-source software and is not available on %s" % (pi.name, git_server)) + return + # skip mesa products (if any) at run time, # unless use_mesa property was activated if not self.forBuild: @@ -724,7 +749,7 @@ class SalomeEnviron: # not mandatory, if set_nativ_env not defined, we do nothing if "set_nativ_env" in dir(pyproduct): pyproduct.set_nativ_env(self) - except: + except Exception: __, exceptionValue, exceptionTraceback = sys.exc_info() print(exceptionValue) import traceback @@ -754,7 +779,7 @@ class SalomeEnviron: def set_full_environ(self, logger, env_info): """\ - Sets the full environment for products + Sets the full environment for products, with their dependencies specified in env_info dictionary. :param logger Logger: The logger instance to display messages @@ -767,9 +792,13 @@ class SalomeEnviron: # use the sorted list of all products to sort the list of products # we have to set + visited=[] + from compile import depth_search_graph # to get the dependencies + for p_name in env_info: + visited=depth_search_graph(self.all_products_graph, p_name, visited) sorted_product_list=[] for n in self.sorted_product_list: - if n in env_info: + if n in visited: sorted_product_list.append(n) if "Python" in sorted_product_list: @@ -908,6 +937,7 @@ class FileEnvWriter: :return: The path to the generated file :rtype: str """ + additional_env["sat_dist"]=self.config.VARS.dist if not self.silent: self.logger.write(_("Create environment file %s\n") % src.printcolors.printcLabel(filename), 3)