]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
sat #17194 : parametrisation of default value for install_dir
authorcrouzet <nicolas.crouzet@cea.fr>
Tue, 16 Jul 2019 11:56:47 +0000 (13:56 +0200)
committercrouzet <nicolas.crouzet@cea.fr>
Tue, 16 Jul 2019 11:56:47 +0000 (13:56 +0200)
commands/application.py
commands/clean.py
commands/package.py
src/environment.py
src/internal_config/INSTALL_BIN.template
src/internal_config/salomeTools.pyconf
src/product.py

index f700febbbbcf18cb47877603205b146a6e2179f6..92b9a0c328dc66e0c0991a44b12f369354242bf1 100644 (file)
@@ -108,8 +108,8 @@ def create_config_file(config, modules, env_files, logger):
             if src.product.product_is_cpp(mm):
                 # cpp module
                 for aa in src.product.get_product_components(mm):
-                    install_dir = os.path.join(config.APPLICATION.workdir,
-                                               "INSTALL")
+                    install_dir=os.path.join(config.APPLICATION.workdir,
+                                             config.INTERNAL.config.install_dir)
                     mp = os.path.join(install_dir, aa)
                     flagline = add_module_to_appli(f,
                                                    aa,
index 57c292031321ba0d43699198960166c990edb188..2577446356d41b1c780a7b71295c10625f8642d5 100644 (file)
@@ -128,7 +128,8 @@ def get_generated_directories(config, products_infos):
         generate_dir = os.path.join(workdir, "GENERATED")
         source_dir = os.path.join(generate_dir, compo + "_SRC")
         build_dir = os.path.join(os.path.join(workdir, "BUILD"), compo)
-        install_dir = os.path.join(os.path.join(workdir, "INSTALL"), compo)
+        install_dir = os.path.join(workdir, config.INTERNAL.config.install_dir,
+                                   compo)
         l_dir_install.append(src.Path(source_dir))
         l_dir_install.append(src.Path(build_dir))
         l_dir_install.append(src.Path(install_dir))
index ec2a16cafc30c46b72b7cfda785fb7ffdb336ffd..f951028f093940fb90e572a37c54c01e98fc453b 100644 (file)
@@ -393,7 +393,8 @@ def produce_install_bin_file(config,
         loop_cmd = "for f in $(grep -RIl"
         for key in d_sub:
             loop_cmd += " -e "+ key
-        loop_cmd += ' INSTALL); do\n     sed -i "\n'
+        loop_cmd += ' ' + config.INTERNAL.config.install_dir +\
+                    '); do\n     sed -i "\n'
         for key in d_sub:
             loop_cmd += "        s?" + key + "?$(pwd)/" + d_sub[key] + "?g\n"
         loop_cmd += '            " $f\ndone'
@@ -401,6 +402,7 @@ def produce_install_bin_file(config,
         d={}
         d["BINARIES_DIR"] = binaries_dir_name
         d["SUBSTITUTION_LOOP"]=loop_cmd
+        d["INSTALL_DIR"]=config.INTERNAL.config.install_dir
         
         # substitute the template and write it in file
         content=src.template.substitute(installbin_template_path, d)
@@ -542,7 +544,8 @@ def binary_package(config, logger, options, tmp_working_dir):
             # cpp module
             for name_cpp in src.product.get_product_components(prod_info):
                 install_dir = os.path.join(config.APPLICATION.workdir,
-                                           "INSTALL", name_cpp) 
+                                           config.INTERNAL.config.install_dir,
+                                           name_cpp) 
                 if os.path.exists(install_dir):
                     l_install_dir.append((name_cpp, install_dir))
                 else:
@@ -1503,7 +1506,8 @@ Please add it in file:
         for key in d_bin_files_to_add:
             if key.endswith("(bin)"):
                 source_dir = d_bin_files_to_add[key][0]
-                path_in_archive = d_bin_files_to_add[key][1].replace("BINARIES-" + runner.cfg.VARS.dist,"INSTALL")
+                path_in_archive = d_bin_files_to_add[key][1].replace("BINARIES-" +\
+                   runner.cfg.VARS.dist,runner.cfg.INTERNAL.config.install_dir)
                 if os.path.basename(source_dir)==os.path.basename(path_in_archive):
                     # if basename is the same we will just substitute the dirname 
                     d_paths_to_substitute[os.path.dirname(source_dir)]=\
index f4816e7e239f18dcef76c7523e2dff72c84f1fae..41ec7e5394d75b5d3fa63457664c5567cf22bb95 100644 (file)
@@ -649,7 +649,7 @@ class SalomeEnviron:
                     source_dir_save = pi.source_dir
                     name_save = pi.name
                     pi.install_dir = os.path.join(self.cfg.APPLICATION.workdir,
-                                                  "INSTALL",
+                                                  config.INTERNAL.config.install_dir,
                                                   pi.component_name)
                     if self.for_package:
                         pi.install_dir = os.path.join("out_dir_Path",
index 936362d7844aee90acb0e78574ec68c3374f4590..eb683a8876e367e80a989f9776936746361dfc38 100644 (file)
@@ -2,9 +2,9 @@
 # 
 # This script copies BINARIES content into INSTALL, and substitute paths to enable extra compilation. 
 # If INSTALL already exists : does nothing!
-if [ -d INSTALL ]
+if [ -d ¤{INSTALL_DIR} ]
 then
-    echo Warning: INSTALL already exists! Please rename or delete it before executing this script
+    echo Warning: ¤{INSTALL_DIR} already exists! Please rename or delete it before executing this script
     exit
 fi
 if [ ! -d ¤{BINARIES_DIR} ]
@@ -12,9 +12,9 @@ then
     echo Error: ¤{BINARIES_DIR} directory not found!
     exit
 fi
-mkdir INSTALL
-echo copies ¤{BINARIES_DIR} into INSTALL
-cp -RP ¤{BINARIES_DIR}/*  INSTALL
+mkdir ¤{INSTALL_DIR}
+echo copies ¤{BINARIES_DIR} into ¤{INSTALL_DIR}
+cp -RP ¤{BINARIES_DIR}/*  ¤{INSTALL_DIR}
 echo does the substitutions
 # do the required substitutions
 ¤{SUBSTITUTION_LOOP}
index 50465e91182960a78753ea12054d7bc5c79f1dee..6c678dfe0309826f3be93abb341013babf6d1dec 100644 (file)
@@ -7,6 +7,7 @@ INTERNAL :
     config :
     {    
         copy_prefix : "LOCAL_"
+        install_dir : "INSTALL"
     }
     log :
     {
index 44d20e9faf8bf4b2670f4c1d95d4dfb101ff27dc..3ce700c5ec4b0d12710cdd830a7549c2d09ae07d 100644 (file)
@@ -485,8 +485,8 @@ def get_install_dir(config, base, version, prod_info):
         if "install_dir" not in prod_info or prod_info.install_dir == "base":
             # Set it to the default value (in application directory)
             install_dir = os.path.join(config.APPLICATION.workdir,
-                                                "INSTALL",
-                                                prod_info.name)
+                                       config.INTERNAL.config.install_dir,
+                                       prod_info.name)
         else:
             install_dir = prod_info.install_dir