# Define all possible option for prepare command : sat prepare <options>
parser = src.options.Options()
-parser.add_option('p', 'product', 'list2', 'products',
+parser.add_option('p', 'products', 'list2', 'products',
_('products to prepare. This option can be'
' passed several time to prepare several products.'))
parser.add_option('f', 'force', 'boolean', 'force',
# Construct the arguments to pass to the clean, source and patch commands
args_appli = runner.cfg.VARS.application + ' '
- args_product_opt = '--product '
+ args_product_opt = '--products '
if options.products:
for p_name in options.products:
args_product_opt += ',' + p_name
logger.write("\n", 1)
# Construct the final commands arguments
- args_clean = args_appli + args_product_opt_clean + " --source"
+ args_clean = args_appli + args_product_opt_clean + " --sources"
args_source = args_appli + args_product_opt
args_patch = args_appli + args_product_opt_patch
# If there is no more any product in the command arguments,
# do not call the concerned command
- oExpr = re.compile("^--product *$")
+ oExpr = re.compile("^--products *$")
do_clean = not(oExpr.search(args_product_opt_clean))
do_source = not(oExpr.search(args_product_opt))
do_patch = not(oExpr.search(args_product_opt_patch))
if do_clean:
msg = _("Clean the source directories ...")
logger.write(msg, 3)
- res_clean = runner.clean(args_clean, batch=True, verbose = 0)
+ logger.flush()
+ res_clean, __ = runner.clean(args_clean, batch=True, verbose = 0,
+ logger_add_link = logger)
if res_clean == 0:
- logger.write('%s\n\n' % src.printcolors.printc(src.OK_STATUS), 3)
+ logger.write('%s\n' % src.printcolors.printc(src.OK_STATUS), 3)
+ else:
+ logger.write('%s\n' % src.printcolors.printc(src.KO_STATUS), 3)
if do_source:
- res_source = runner.source(args_source)
+ msg = _("Get the sources of the products ...")
+ logger.write(msg, 5)
+ res_source, __ = runner.source(args_source,
+ logger_add_link = logger)
+ if res_source == 0:
+ logger.write('%s\n' % src.printcolors.printc(src.OK_STATUS), 5)
+ else:
+ logger.write('%s\n' % src.printcolors.printc(src.KO_STATUS), 5)
if do_patch:
- res_patch = runner.patch(args_patch)
+ msg = _("Patch the product sources (if any) ...")
+ logger.write(msg, 5)
+ res_patch, __ = runner.patch(args_patch,
+ logger_add_link = logger)
+ if res_patch == 0:
+ logger.write('%s\n' % src.printcolors.printc(src.OK_STATUS), 5)
+ else:
+ logger.write('%s\n' % src.printcolors.printc(src.KO_STATUS), 5)
return res_clean + res_source + res_patch
\ No newline at end of file