Salome HOME
sat #32534 : warning if the application is used on a not supported platform, and...
[tools/sat.git] / commands / package.py
index 2ff12fd8f52fc92175ee2a8916eda416edd8dd3c..fd5bba7efc07a377ac97c64d3f8b0a7e493d4aea 100644 (file)
@@ -103,6 +103,7 @@ PROJECTS :
 {
   project_file_paths : 
   [
+$LOCAL.workdir + $VARS.sep + \"""" + PROJECT_DIR + """\" + $VARS.sep + "project.pyconf"
   ]
 }
 """)
@@ -121,7 +122,8 @@ parser.add_option('', 'bin_products', 'boolean', 'bin_products',
     _('Optional: Create binary archives for all products.'), False)
 parser.add_option('', 'with_vcs', 'boolean', 'with_vcs',
     _('Optional: Do not make archive for products in VCS mode (git, cvs, svn). ' 
-      'Sat prepare will use VCS mode instead to retrieve them'),
+      'Sat prepare will use VCS mode instead to retrieve them.'
+      '\n          Also, when combined with "--bin_products" option, restrict the building of product archives to VCS products.'),
     False)
 parser.add_option('', 'ftp', 'boolean', 'ftp',
     _('Optional: Do not embed archives for products in archive mode.' 
@@ -317,7 +319,7 @@ def produce_relative_launcher(config,
                           False,  # for launch
                           "cfgForPy",
                           additional_env=additional_env,
-                          no_path_init="False",
+                          no_path_init=False,
                           for_package = binaries_dir_name)
     
     # Little hack to put out_dir_Path outside the strings
@@ -446,6 +448,7 @@ def produce_relative_env_files(config,
     else:
       src.replace_in_file(filepath, '"out_dir_Path', '"${out_dir_Path}' )
       src.replace_in_file(filepath, ':out_dir_Path', ':${out_dir_Path}' )
+      src.replace_in_file(filepath, ';out_dir_Path', ';${out_dir_Path}' )
 
     if exe_name:
         if src.architecture.is_windows():
@@ -622,7 +625,7 @@ def bin_products_archives(config, logger, only_vcs):
             l_not_installed.append(prod_name)
             continue  # product is not installed, we skip it
         # prepare call to make_bin_archive
-        path_targz_prod = os.path.join(binpackage_path, prod_name + '-' + prod_info.version + "-" + config.VARS.dist + PACKAGE_EXT) 
+        path_targz_prod = os.path.join(binpackage_path, prod_name + '-' + prod_info.version.replace("/", "_") + "-" + config.VARS.dist + PACKAGE_EXT)
         targz_prod = tarfile.open(path_targz_prod, mode='w:gz')
         bin_path = prod_info.install_dir
         targz_prod.add(bin_path)
@@ -791,11 +794,16 @@ WARNING: existing binaries directory from previous detar installation:
         
     for prod_name, source_dir in l_source_dir:
         path_in_archive = os.path.join("SOURCES", prod_name)
-        logpath_in_archive = os.path.join("LOGS", prod_name)
-        logpath=os.path.join(src.get_log_path(config), prod_name)
         d_products[prod_name + " (sources)"] = (source_dir, path_in_archive)
-        d_products[prod_name + " (logs)"] = (logpath, logpath_in_archive)
 
+    # create an archives of compilation logs, and insert it into the tarball
+    logpath=os.path.join(config.APPLICATION.workdir, "LOGS")
+    path_targz_logs = os.path.join(tmp_working_dir, "logs.tgz")
+    tar_log = tarfile.open(path_targz_logs, mode='w:gz')
+    tar_log.add(logpath, arcname="LOGS")
+    tar_log.close()
+    d_products["LOGS"] = (path_targz_logs, "logs.tgz")
     # for packages of SALOME applications including KERNEL, 
     # we produce a salome launcher or a virtual application (depending on salome version)
     if 'KERNEL' in config.APPLICATION.products:
@@ -1310,7 +1318,9 @@ def find_product_scripts_and_pyconf(p_name,
                     product_pyconf_cfg[section].archive_info.archive_name =\
                         p_info.name + ".tgz"
     
-    if (with_vcs) and src.product.product_is_vcs(p_info):
+    # save git repositories for vcs products, even if archive is not in VCS mode
+    # in this case the user will be able to change get_source flag and work with git
+    if src.product.product_is_vcs(p_info):
         # in vcs mode we must replace explicitely the git server url
         # (or it will not be found later because project files are not exported in archives)
         for section in product_pyconf_cfg:
@@ -1353,7 +1363,7 @@ def write_application_pyconf(config, application_tmp_dir):
         app.workdir = src.pyconf.Reference(
                                  app,
                                  src.pyconf.DOLLAR,
-                                 'VARS.salometoolsway + $VARS.sep + ".."')
+                                 'LOCAL.workdir')
         res.addMapping("APPLICATION", app, "")
         res.__save__(f, evaluated=False)