Salome HOME
adapt the naming to multi-options
authorcrouzet <nicolas.crouzet@cea.fr>
Fri, 28 Apr 2017 13:40:09 +0000 (15:40 +0200)
committercrouzet <nicolas.crouzet@cea.fr>
Fri, 28 Apr 2017 13:40:09 +0000 (15:40 +0200)
commands/package.py

index 38bd052925148bf368a6f46621f6901e4bb4e0d6..5f3476141f59a306f9152cd9cb15ac48d69468c4 100644 (file)
@@ -1137,35 +1137,27 @@ def run(args, runner, logger):
             archive_name = archive_name[:-len(".tar.gz")]
         
     else:
+        archive_name=""
         dir_name = package_default_path
+        if options.binaries or options.sources:
+            archive_name = runner.cfg.APPLICATION.name
+
         if options.binaries:
-            archive_name = (runner.cfg.APPLICATION.name +
-                            "-" +
-                            runner.cfg.VARS.dist)
+            archive_name += "_"+runner.cfg.VARS.dist
             
-        elif options.sources:
-            archive_name = (runner.cfg.APPLICATION.name +
-                            "-" +
-                            "SRC")
+        if options.sources:
+            archive_name += "_SRC"
             if options.with_vcs:
-                archive_name = (runner.cfg.APPLICATION.name +
-                            "-" +
-                            "SRC" +
-                            "-" +
-                            "VCS")
+                archive_name += "_VCS"
 
-        elif options.project:
+        if options.project:
             project_name, __ = os.path.splitext(
                                             os.path.basename(options.project))
-            archive_name = ("PROJECT" +
-                            "-" +
-                            project_name)
+            archive_name += ("PROJECT_" + project_name)
  
-        elif options.sat:
-            archive_name = ("salomeTools" +
-                            "-" +
-                            runner.cfg.INTERNAL.sat_version)
-        else:
+        if options.sat:
+            archive_name += ("salomeTools_" + runner.cfg.INTERNAL.sat_version)
+        if len(archive_name)==0: # no option worked 
             msg = _("Error: Cannot name the archive\n"
                     " check if at least one of the following options was "
                     "selected : --binaries, --sources, --project or"
@@ -1232,7 +1224,7 @@ def run(args, runner, logger):
                                                       "install_bin.sh")
             d_files_to_add.update({"install_bin" : (file_install_bin, "install_bin.sh")})
             logger.write("substitutions that need to be done later : \n", 5)
-            logger.write(d_paths_to_substitute, 5)
+            logger.write(str(d_paths_to_substitute), 5)
             logger.write("\n", 5)
     else:
         # --salomeTool option is not considered when --sources is selected, as this option