if len(l_dir_to_suppress) == 0:
logger.write(src.printcolors.printcWarning(_("Nothing to suppress\n")))
- sat_command = (runner.cfg.VARS.salometoolsway +
- runner.cfg.VARS.sep +
- "sat -h clean")
- logger.write(_("Please specify what you want to suppress: "
- "tap \"%s\"\n" % sat_command))
+ logger.write(_("""\
+Please specify what you want to suppress:
+try 'sat --help clean' and 'sat clean ... --products ... --sources --build --install
+"""))
return
# Check with the user if he really wants to suppress the directories
# Suppress the list of paths
suppress_directories(l_dir_to_suppress, logger)
- return 0
\ No newline at end of file
+ return 0
import os
import src
+import src.debug as DBG
# Define all possible option for prepare command : sat prepare <options>
parser = src.options.Options()
:return: The updated arguments.
:rtype: str
'''
- args = arguments
- for i, (product_name, __) in enumerate(l_products_info):
- args = args.replace(',' + product_name, '')
- end_text = ', '
- if i+1 == len(l_products_info):
- end_text = '\n'
- logger.write(product_name + end_text, 1)
- return args
+ args = str(arguments) #copy of "--products ,XDATA,TESSCODE,cmake" for example
+ largs = args.split(',')
+ DBG.write("largs", largs)
+ toRemove = [name for name,_ in l_products_info]
+ DBG.write("remove_products", toRemove)
+ removed = []
+ notRemoved = []
+ for name in largs[1:]: # skip largs[0] as "--products "
+ if name in toRemove:
+ removed.append(name)
+ else:
+ notRemoved.append(name)
+ # DBG.write(removed, removed, True)
+ logger.write(" %s\n" % ",".join(removed), 1)
+ DBG.write("notRemoved", notRemoved)
+ res = largs[0] + ",".join(notRemoved)
+ return res
def find_products_already_getted(l_products):
'''function that returns the list of products that have an existing source
if not options.force and len(ldev_products) > 0:
l_products_not_getted = find_products_already_getted(ldev_products)
if len(l_products_not_getted) > 0:
- msg = _("Do not get the source of the following products "
- "in development mode\nUse the --force option to"
- " overwrite it.\n")
+ msg = _("""\
+Do not get the source of the following products in development mode
+Use the --force option to overwrite it.
+""")
logger.write(src.printcolors.printcWarning(msg), 1)
args_product_opt_clean = remove_products(args_product_opt_clean,
l_products_not_getted,
if not options.force_patch and len(ldev_products) > 0:
l_products_with_patchs = find_products_with_patchs(ldev_products)
if len(l_products_with_patchs) > 0:
- msg = _("do not patch the following products "
- "in development mode\nUse the --force_patch option to"
- " overwrite it.\n")
+ msg = _("""\
+do not patch the following products in development mode
+Use the --force_patch option to overwrite it.
+""")
logger.write(src.printcolors.printcWarning(msg), 1)
args_product_opt_patch = remove_products(args_product_opt_patch,
l_products_with_patchs,
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
+ return res_clean + res_source + res_patch
# Get the full paths of all the patches
if product_has_patches(prod_info):
patches = []
- for patch in prod_info.patches:
- patch_path = patch
- # If only a filename, then search for the patch in the PRODUCTPATH
- if os.path.basename(patch_path) == patch_path:
- # Search in the PRODUCTPATH/patches
- patch_path = src.find_file_in_lpath(patch,
- config.PATHS.PRODUCTPATH,
- "patches")
- if not patch_path:
- msg = _("Patch %(patch_name)s for %(prod_name)s not found:"
- "\n" % {"patch_name" : patch,
- "prod_name" : prod_info.name})
- raise src.SatException(msg)
- patches.append(patch_path)
+ try:
+ for patch in prod_info.patches:
+ patch_path = patch
+ # If only a filename, then search for the patch in the PRODUCTPATH
+ if os.path.basename(patch_path) == patch_path:
+ # Search in the PRODUCTPATH/patches
+ patch_path = src.find_file_in_lpath(patch,
+ config.PATHS.PRODUCTPATH,
+ "patches")
+ if not patch_path:
+ msg = _("Patch %(patch_name)s for %(prod_name)s not found:"
+ "\n" % {"patch_name" : patch,
+ "prod_name" : prod_info.name})
+ raise src.SatException(msg)
+ patches.append(patch_path)
+ except:
+ DBG.tofix("problem in prod_info.patches", prod_info)
prod_info.patches = patches
# Get the full paths of the environment scripts
:rtype: boolean
'''
dev = product_info.dev
- return dev.lower() == 'yes'
+ res = (dev.lower() == 'yes')
+ DBG.write('product_is_dev %s' % product_info.name, res)
+ # if product_info.name == "XDATA": return True #test #10569
+ return res
def product_is_debug(product_info):
'''Know if a product is in debug mode
the product
:return: True if the product has one or more patches
:rtype: boolean
- '''
- return "patches" in product_info and len(product_info.patches) > 0
+ '''
+ res = ( "patches" in product_info and len(product_info.patches) > 0 )
+ DBG.write('product_has_patches %s' % product_info.name, res)
+ # if product_info.name == "XDATA": return True #test #10569
+ return res
def product_has_logo(product_info):
'''Know if a product has a logo (YACSGEN generate)