]> SALOME platform Git repositories - tools/sat.git/blobdiff - src/environment.py
Salome HOME
specialisation des paquets systemes par distribution, pour mieux gerer les differences
[tools/sat.git] / src / environment.py
index d5a98110638b102e2d1b313abe74ec7afaef5b1a..f44c13105716ade802d17f4278d30c3579a7e53e 100644 (file)
@@ -234,7 +234,7 @@ class SalomeEnviron:
                                  self.cfg.APPLICATION.products,
                                  self.cfg)
         
-        all_products_graph=get_dependencies_graph(all_products_infos)
+        all_products_graph=get_dependencies_graph(all_products_infos, self.forBuild)
         visited_nodes=[]
         sorted_nodes=[]
         for n in all_products_graph:
@@ -380,17 +380,14 @@ class SalomeEnviron:
         """
         
         if self.for_package:
-           self.set("PRODUCT_ROOT_DIR", "out_dir_Path")
+           if src.architecture.is_windows():
+              self.set("PRODUCT_ROOT_DIR", "%out_dir_Path%")
+           else:
+              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")
-        self.add_comment("comment these to lines if you wish a different behaviour")
-        self.set("LD_LIBRARY_PATH", "")
-        self.set("PYTHONPATH", "")
-        self.add_line(1)
 
         # Set the variables defined in the "environ" section
         if 'environ' in self.cfg.APPLICATION:
@@ -603,10 +600,14 @@ class SalomeEnviron:
                
         
         if self.for_package:
+            prod_base_name=os.path.basename(pi.install_dir)
+            if prod_base_name.startswith("config"):
+                # case of a products installed in base. We remove "config-i"
+                prod_base_name=os.path.basename(os.path.dirname(pi.install_dir))
             pi.install_dir = os.path.join(
                                  "out_dir_Path",
                                  self.for_package,
-                                 os.path.basename(pi.install_dir))
+                                 prod_base_name)
 
         if not self.silent:
             logger.write(_("Setting environment for %s\n") % product, 4)
@@ -637,6 +638,12 @@ class SalomeEnviron:
             logger.write("licence file found for product %s : %s\n" % (pi.name, licence_file_name), 5) 
             self.set("LICENCE_FILE", licence_file_name)
 
+        # these infos may be needed for the environment of some products
+        if "debug" in pi and pi.debug == "yes":
+            self.set("SAT_DEBUG", "1")
+        if "verbose" in pi and pi.verbose == "yes":
+            self.set("SAT_VERBOSE", "1")
+
         if src.product.product_is_cpp(pi):
             # set a specific environment for cpp modules
             self.set_salome_minimal_product_env(pi, logger)