buildman: Pass option values to get_action_summary()
Pass in the individual values rather than the whole options object, so we can see what is needed. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -29,22 +29,30 @@ def get_plural(count):
|
|||||||
"""Returns a plural 's' if count is not 1"""
|
"""Returns a plural 's' if count is not 1"""
|
||||||
return 's' if count != 1 else ''
|
return 's' if count != 1 else ''
|
||||||
|
|
||||||
def get_action_summary(is_summary, commits, selected, options):
|
def get_action_summary(is_summary, commits, selected, step, threads, jobs):
|
||||||
"""Return a string summarising the intended action.
|
"""Return a string summarising the intended action.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
is_summary (bool): True if this is a summary (otherwise it is building)
|
||||||
|
commits (list): List of commits being built
|
||||||
|
selected (list of Board): List of Board objects that are marked
|
||||||
|
step (int): Step increment through commits
|
||||||
|
threads (int): Number of processor threads being used
|
||||||
|
jobs (int): Number of jobs to build at once
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Summary string.
|
Summary string.
|
||||||
"""
|
"""
|
||||||
if commits:
|
if commits:
|
||||||
count = len(commits)
|
count = len(commits)
|
||||||
count = (count + options.step - 1) // options.step
|
count = (count + step - 1) // step
|
||||||
commit_str = f'{count} commit{get_plural(count)}'
|
commit_str = f'{count} commit{get_plural(count)}'
|
||||||
else:
|
else:
|
||||||
commit_str = 'current source'
|
commit_str = 'current source'
|
||||||
msg = (f"{'Summary of' if is_summary else 'Building'} "
|
msg = (f"{'Summary of' if is_summary else 'Building'} "
|
||||||
f'{commit_str} for {len(selected)} boards')
|
f'{commit_str} for {len(selected)} boards')
|
||||||
msg += (f' ({options.threads} thread{get_plural(options.threads)}, '
|
msg += (f' ({threads} thread{get_plural(threads)}, '
|
||||||
f'{options.jobs} job{get_plural(options.jobs)} per thread)')
|
f'{jobs} job{get_plural(jobs)} per thread)')
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
# pylint: disable=R0913
|
# pylint: disable=R0913
|
||||||
@@ -73,7 +81,7 @@ def show_actions(series, why_selected, boards_selected, output_dir, options,
|
|||||||
else:
|
else:
|
||||||
commits = None
|
commits = None
|
||||||
print(get_action_summary(False, commits, boards_selected,
|
print(get_action_summary(False, commits, boards_selected,
|
||||||
options))
|
options.step, options.threads, options.jobs))
|
||||||
print(f'Build directory: {output_dir}')
|
print(f'Build directory: {output_dir}')
|
||||||
if commits:
|
if commits:
|
||||||
for upto in range(0, len(series.commits), options.step):
|
for upto in range(0, len(series.commits), options.step):
|
||||||
@@ -152,7 +160,7 @@ def determine_series(selected, col, git_dir, count, branch, work_in_output):
|
|||||||
"""Determine the series which is to be built, if any
|
"""Determine the series which is to be built, if any
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
selected (list of Board(: List of Board objects that are marked
|
selected (list of Board): List of Board objects that are marked
|
||||||
selected
|
selected
|
||||||
col (Terminal.Color): Color object to use
|
col (Terminal.Color): Color object to use
|
||||||
git_dir (str): Git directory to use, e.g. './.git'
|
git_dir (str): Git directory to use, e.g. './.git'
|
||||||
@@ -523,7 +531,7 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None,
|
|||||||
|
|
||||||
if not options.ide:
|
if not options.ide:
|
||||||
tprint(get_action_summary(options.summary, commits, board_selected,
|
tprint(get_action_summary(options.summary, commits, board_selected,
|
||||||
options))
|
options.step, options.threads, options.jobs))
|
||||||
|
|
||||||
# We can't show function sizes without board details at present
|
# We can't show function sizes without board details at present
|
||||||
if options.show_bloat:
|
if options.show_bloat:
|
||||||
|
Reference in New Issue
Block a user