Salome HOME
portage platform windows
authorcrouzet <nicolas.crouzet@cea.fr>
Wed, 6 Nov 2019 16:16:50 +0000 (17:16 +0100)
committercrouzet <nicolas.crouzet@cea.fr>
Wed, 6 Nov 2019 16:16:50 +0000 (17:16 +0100)
src/environment.py
src/fileEnviron.py

index fd94a36196bae716cd2d8df3ce54ac9524ded6e8..d5a98110638b102e2d1b313abe74ec7afaef5b1a 100644 (file)
@@ -54,10 +54,15 @@ class Environ:
         :return: the replaced variable
         :rtype: str
         """
-        if "$" in value:
+        if src.architecture.is_windows():
+            delim = "%"
+        else:
+            delim = "$"
+        if delim in value:
             # The string.Template class is a string class 
             # for supporting $-substitutions
             zt = string.Template(value)
+            zt.delimiter = delim
             try:
                 value = zt.substitute(self.environ)
             except KeyError as exc:
@@ -447,7 +452,6 @@ class SalomeEnviron:
         # Construct XXX_ROOT_DIR
         env_root_dir = self.get(pi.name + "_ROOT_DIR")
         l_binpath_libpath = []
-
         # create additional ROOT_DIR for CPP components
         if 'component_name' in pi:
             compo_name = pi.component_name
@@ -573,7 +577,6 @@ class SalomeEnviron:
 
         # Get the informations corresponding to the product
         pi = src.product.get_product_config(self.cfg, product)
-        
         # skip compile time products at run time 
         if not self.forBuild:
             if src.product.product_is_compile_time(pi):
@@ -758,7 +761,6 @@ class SalomeEnviron:
         """
         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)
 
@@ -908,7 +910,6 @@ class FileEnvWriter:
         if not self.silent:
             self.logger.write(_("Create environment file %s\n") % 
                               src.printcolors.printcLabel(filename), 3)
-
         # create then env object
         env_file = open(os.path.join(self.out_dir, filename), "w")
 
@@ -936,11 +937,9 @@ class FileEnvWriter:
         else:
             # set env from the APPLICATION
             env.set_application_env(self.logger)
-            
             # set the products
             env.set_products(self.logger,
                             src_root=self.src_root)
-
         # Add the additional environment if it is not empty
         if len(additional_env) != 0:
             env.add_line(1)
index aa89e0dfd0bbe28c7b7395c2297431e0e42f2ef6..b2feabe587904ad54101fb75946388c8a03bd960 100644 (file)
@@ -210,7 +210,10 @@ class FileEnviron(object):
         
         :param key str: the environment variable
         """
-        return '${%s}' % key
+        if src.architecture.is_windows():
+            return '%' + key + '%'
+        else:
+            return '${%s}' % key
 
     def get_value(self, key):
         """Get the real value of the environment variable "key"