]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
sat #8655 : ajout de l'option --packages à sat clean
authorcrouzet <nicolas.crouzet@cea.fr>
Mon, 4 Feb 2019 11:11:28 +0000 (12:11 +0100)
committercrouzet <nicolas.crouzet@cea.fr>
Mon, 4 Feb 2019 11:11:28 +0000 (12:11 +0100)
commands/clean.py
complete_sat.sh
doc/src/commands/clean.rst

index cd8d5f88e7dcf8dd1a21fcb17f3bda97074c064a..1566fd626d283da935a47d24739847e6fb5eceb1 100644 (file)
@@ -41,6 +41,8 @@ parser.add_option('i', 'install', 'boolean', 'install',
     _("Optional: Clean the product install directories."))
 parser.add_option('g', 'generated', 'boolean', 'generated', 
     _("Optional: Clean source, build and install directories for generated products."))
+parser.add_option('', 'package', 'boolean', 'package', 
+    _("Optional: Clean packages produced by sat package command."))
 parser.add_option('a', 'all', 'boolean', 'all', 
     _("Optional: Clean the product source, build and install directories."))
 parser.add_option('', 'sources_without_dev', 'boolean', 'sources_without_dev', 
@@ -97,6 +99,16 @@ def get_install_directories(products_infos):
             l_dir_install.append(src.Path(product_info.install_dir))
     return l_dir_install
 
+def get_package_directory(config):
+    """\
+    Returns the package directory name corresponding to the sat package command
+    
+    :param config Config: The global configuration
+    :return: a list containing the PACKAGE full path.
+    :rtype: list
+    """
+    return [src.Path(os.path.join(config.APPLICATION.workdir, "PACKAGE"))]
+
 def get_generated_directories(config, products_infos):
     """\
     Returns the list of directories (source, build, install) corresponding to the 
@@ -194,7 +206,8 @@ def run(args, runner, logger):
                                             options.sources_without_dev) +
                              get_build_directories(products_infos) + 
                              get_install_directories(products_infos) + 
-                             get_generated_directories(runner.cfg, products_infos) )
+                             get_generated_directories(runner.cfg, products_infos) + 
+                             get_package_directory(runner.cfg) )
     else:
         if options.install:
             l_dir_to_suppress += get_install_directories(products_infos)
@@ -207,6 +220,9 @@ def run(args, runner, logger):
                                                 options.sources_without_dev)
         if options.generated:
             l_dir_to_suppress += get_generated_directories(runner.cfg, products_infos)
+
+        if options.package:
+            l_dir_to_suppress += get_package_directory(runner.cfg)
     
     if len(l_dir_to_suppress) == 0:
         logger.write(src.printcolors.printcWarning(_("Nothing to suppress\n")))
index ca3a131faadec6a186d9fe9f6f1e7a8f9de8f5e8..d14c7f3399b9257cdd1ff50dbc7c73bc64fdf93f 100755 (executable)
@@ -167,7 +167,7 @@ _salomeTools_complete()
             return 0
             ;;
         clean)
-            opts="--products --sources --build --install --generated --all --sources_without_dev --properties"
+            opts="--products --sources --build --install --generated --package --all --sources_without_dev --properties"
             COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
             return 0
             ;;
index 4aa2413ff01869b0cc17d525ef9c68e0017aa92b..00ef3630603a65772a4cd161a91d54f0d13a874d 100644 (file)
@@ -48,6 +48,8 @@ Availables options
 
   * **--generated : Clean source, build and install directories for generated products.
 
+  * **--package : Clean the application package directory.
+
   * **--all** : Clean the product source, build and install directories.
 
   * **--sources_without_dev** :