This file is no-longer needed by buildman but it is still generated in the
working directory. This helps avoid a delay on every build, since scanning all
the Kconfig files takes a few seconds. Use the -R flag to force regeneration
-of the file - in that case buildman exits after writing the file.
+of the file - in that case buildman exits after writing the file. with exit code
+2 if there was an error in the maintainer files.
You should use 'buildman -nv <criteria>' instead of greoing the boards.cfg file,
since it may be dropped altogether in future.
value: tuple:
str: Board status (e.g. 'Active')
str: List of maintainers, separated by :
+ warnings (list of str): List of warnings due to missing status, etc.
"""
def __init__(self):
"""Create an empty database."""
self.database = {}
+ self.warnings = []
def get_status(self, target):
"""Return the status of the given board.
str: 'Active', 'Orphan' or '-'.
"""
if not target in self.database:
- print(f"WARNING: no status info for '{target}'", file=sys.stderr)
+ self.warnings.append(f"WARNING: no status info for '{target}'")
return '-'
tmp = self.database[target][0]
return 'Active'
if tmp.startswith('Orphan'):
return 'Orphan'
- print(f"WARNING: {tmp}: unknown status for '{target}'", file=sys.stderr)
+ self.warnings.append(f"WARNING: {tmp}: unknown status for '{target}'")
return '-'
def get_maintainers(self, target):
maintainers, they are separated with colons.
"""
if not target in self.database:
- print(f"WARNING: no maintainers for '{target}'", file=sys.stderr)
+ self.warnings.append(f"WARNING: no maintainers for '{target}'")
return ''
return ':'.join(self.database[target][1])
Args:
params_list (list of dict): A list of the board parameters
+
+ Returns:
+ list of str: List of warnings collected due to missing status, etc.
"""
database = MaintainersDatabase()
for (dirpath, _, filenames) in os.walk('.'):
params['status'] = database.get_status(target)
params['maintainers'] = database.get_maintainers(target)
params_list[i] = params
+ return database.warnings
@classmethod
def format_and_output(cls, params_list, output):
jobs (int): The number of jobs to run simultaneously
force (bool): Force to generate the output even if it is new
quiet (bool): True to avoid printing a message if nothing needs doing
+
+ Returns:
+ bool: True if all is well, False if there were warnings
"""
if not force and output_is_new(output):
if not quiet:
print(f'{output} is up to date. Nothing to do.')
- return
+ return True
params_list = self.scan_defconfigs(jobs)
- self.insert_maintainers_info(params_list)
+ warnings = self.insert_maintainers_info(params_list)
+ for warn in warnings:
+ print(warn, file=sys.stderr)
self.format_and_output(params_list, output)
+ return not warnings
board_file = os.path.join(options.output_dir, 'boards.cfg')
brds = boards.Boards()
- brds.ensure_board_list(board_file,
- options.threads or multiprocessing.cpu_count(),
- force=options.regen_board_list,
- quiet=not options.verbose)
+ ok = brds.ensure_board_list(board_file,
+ options.threads or multiprocessing.cpu_count(),
+ force=options.regen_board_list,
+ quiet=not options.verbose)
if options.regen_board_list:
- return 0
+ return 0 if ok else 2
brds.read_boards(board_file)
exclude = []