X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=commands%2Fmakeinstall.py;h=8a2a07a186093c48e9a6e782ee7aba4ac55ec7e8;hb=620d5d2e941088d41984043bb7fae889da5a52b1;hp=bff343148fc522ec393c4b4d27f66b83c800d470;hpb=2f38beaea8436fdb26d4f2516340cf33361d0b95;p=tools%2Fsat.git diff --git a/commands/makeinstall.py b/commands/makeinstall.py index bff3431..8a2a07a 100644 --- a/commands/makeinstall.py +++ b/commands/makeinstall.py @@ -20,44 +20,11 @@ import os import src -# Define all possible option for the makeinstall command : sat makeinstall +# Define all possible option for the makeinstall command : sat makeinstall parser = src.options.Options() parser.add_option('p', 'products', 'list2', 'products', - _('products to configure. This option can be' - ' passed several time to configure several products.')) + _('Optional: products to install. This option accepts a comma separated list.')) -def get_products_list(options, cfg, logger): - '''method that gives the product list with their informations from - configuration regarding the passed options. - - :param options Options: The Options instance that stores the commands - arguments - :param cfg Config: The global configuration - :param logger Logger: The logger instance to use for the display and logging - :return: The list of (product name, product_informations). - :rtype: List - ''' - # Get the products to be prepared, regarding the options - if options.products is None: - # No options, get all products sources - products = cfg.APPLICATION.products - else: - # if option --products, check that all products of the command line - # are present in the application. - products = options.products - for p in products: - if p not in cfg.APPLICATION.products: - raise src.SatException(_("Product %(product)s " - "not defined in application %(application)s") % - { 'product': p, 'application': cfg.VARS.application} ) - - # Construct the list of tuple containing - # the products name and their definition - products_infos = src.product.get_products_infos(products, cfg) - - products_infos = [pi for pi in products_infos if not(src.product.product_is_native(pi[1]) or src.product.product_is_fixed(pi[1]))] - - return products_infos def log_step(logger, header, step): logger.write("\r%s%s" % (header, " " * 20), 3) @@ -108,12 +75,19 @@ def makeinstall_product(p_name_info, config, logger): # Logging logger.write("\n", 4, False) logger.write("################ ", 4) - header = _("Make of %s") % src.printcolors.printcLabel(p_name) + header = _("Make install of %s") % src.printcolors.printcLabel(p_name) header += " %s " % ("." * (20 - len(p_name))) logger.write(header, 3) logger.write("\n", 4, False) logger.flush() - + + # Do nothing if he product is not compilable + if ("properties" in p_info and "compilation" in p_info.properties and + p_info.properties.compilation == "no"): + log_step(logger, header, "ignored") + logger.write("\n", 3, False) + return 0 + # Instantiate the class that manages all the construction commands # like cmake, make, make install, make test, environment management, etc... builder = src.compilation.Builder(config, logger, p_info) @@ -157,7 +131,10 @@ def description(): :rtype: str ''' return _("The makeinstall command executes the \"make install\" command in" - " the build directory") + " the build directory.\nIn case of product that is constructed " + "using a script (build_source : \"script\"), then the " + "makeinstall command do nothing.\n\nexample:\nsat makeinstall " + "SALOME-master --products KERNEL,GUI") def run(args, runner, logger): '''method that is called when salomeTools is called with makeinstall parameter. @@ -169,8 +146,8 @@ def run(args, runner, logger): # check that the command has been called with an application src.check_config_has_application( runner.cfg ) - # Get the list of products to threat - products_infos = get_products_list(options, runner.cfg, logger) + # Get the list of products to treat + products_infos = src.product.get_products_list(options, runner.cfg, logger) # Print some informations logger.write(_('Executing the make install command in the build directories of the application %s\n') %