"products",
_("Optional: products to upgrade. This option accepts a comma separated list."),
)
-parser.add_option(
- "f",
- "force",
- "boolean",
- "force",
- "Optional: force the compilation of product, even if it is already "
- "installed. The BUILD directory is cleaned before compilation.",
-)
parser.add_option(
"",
"with_fathers",
logger.flush()
-def upgrade_all_products(
+def clean_before_build(
sat, config, options, products_infos, all_products_dict, all_products_graph, logger
):
- """Execute the proper configuration commands
- in each product build directory.
-
- :param config Config: The global configuration
- :param products_info list: List of
- (str, Config) => (product_name, product_info)
- :param all_products_dict: Dict of all products
- :param all_products_graph: graph of all products
- :param logger Logger: The logger instance to use for the display and logging
- :return: the number of failing commands.
- :rtype: int
- """
- # first loop for the cleaning
check_salome_configuration = False
updated_products = []
for p_name_info in products_infos:
):
continue
- # Clean the the install directory
- # if the corresponding option was called
- if options.force:
- sat.clean(
- config.VARS.application + " --products " + p_name + " --build",
- batch=True,
- verbose=0,
- logger_add_link=logger,
- )
-
if src.product.product_is_vcs(p_info):
try:
do_update = False
if do_update:
updated_products.append(p_name)
sat.clean(
- config.VARS.application + " --products " + p_name + " --install",
+ config.VARS.application
+ + " --products "
+ + p_name
+ + " --install",
batch=True,
verbose=0,
logger_add_link=logger,
res += 1
if res > 0:
return res # error configure dependency : we stop the compilation
+ return 0
+
+
+def upgrade_all_products(
+ sat, config, options, products_infos, all_products_dict, all_products_graph, logger
+):
+ """Execute the proper configuration commands
+ in each product build directory.
+
+ :param config Config: The global configuration
+ :param products_info list: List of
+ (str, Config) => (product_name, product_info)
+ :param all_products_dict: Dict of all products
+ :param all_products_graph: graph of all products
+ :param logger Logger: The logger instance to use for the display and logging
+ :return: the number of failing commands.
+ :rtype: int
+ """
+ # first loop for the cleaning
+ clean_before_build(
+ sat,
+ config,
+ options,
+ products_infos,
+ all_products_dict,
+ all_products_graph,
+ logger,
+ )
# second loop to upgrade
res = 0
# if we don't force compilation, check if the was already successfully installed.
# we don't compile in this case.
- if (not options.force) and src.product.check_installation(config, p_info):
+ if src.product.check_installation(config, p_info):
logger.write(_("Already installed"))
logger.write(_(" in %s" % p_info.install_dir), 4)
logger.write(_("\n"))
# Parse the options
(options, args) = parser.parse_args(args)
- if options.force:
- options.update = False # update is useless in this case
-
# check that the command has been called with an application
src.check_config_has_application(runner.cfg)
runner.cfg.APPLICATION.products, runner.cfg
)
all_products_graph = get_dependencies_graph(all_products_infos)
- # logger.write("Dependency graph of all application products : %s\n" % all_products_graph, 6)
- DBG.write("Dependency graph of all application products : ", all_products_graph)
+ logger.write(
+ "Dependency graph of all application products : %s\n" % all_products_graph, 6
+ )
+ # DBG.write("Dependency graph of all application products : ", all_products_graph)
# Get the list of products we have to upgrade
products_infos = src.product.get_products_list(options, runner.cfg, logger)