]> 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)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Wed, 17 Jul 2019 08:07:27 +0000 (10:07 +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 267a29370a68afb0c83f76753130985b005dc691..68817fb5881c7bb5c4ce37415cb44660ace97141 100644 (file)
@@ -400,7 +400,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'
@@ -408,6 +409,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)
@@ -549,7 +551,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:
@@ -1514,7 +1517,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 08565ce752ec4004fe10c411278e0fb9aee0d578..20a5c1eb95dc0b4f6a58873ffa657305a57909d0 100644 (file)
@@ -653,7 +653,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 401f6ccc15f992feefa1f876996a73a544c7f707..cdb3ab0a2b26f1410da1a33b984961754a2335f8 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