From: crouzet Date: Mon, 4 Feb 2019 11:11:28 +0000 (+0100) Subject: sat #8655 : ajout de l'option --packages à sat clean X-Git-Tag: 5.3.0~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=75817f5dd89374d925aa9c6c42fb5c4d48a943f3;p=tools%2Fsat.git sat #8655 : ajout de l'option --packages à sat clean --- diff --git a/commands/clean.py b/commands/clean.py index cd8d5f8..1566fd6 100644 --- a/commands/clean.py +++ b/commands/clean.py @@ -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"))) diff --git a/complete_sat.sh b/complete_sat.sh index ca3a131..d14c7f3 100755 --- a/complete_sat.sh +++ b/complete_sat.sh @@ -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 ;; diff --git a/doc/src/commands/clean.rst b/doc/src/commands/clean.rst index 4aa2413..00ef363 100644 --- a/doc/src/commands/clean.rst +++ b/doc/src/commands/clean.rst @@ -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** :