buildman: Move dry-run handling higher in do_buildman()

Move this up above where the builder is created, since it no-longer makes
use of the builder.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2023-07-19 17:48:37 -06:00
parent d233dfb07d
commit f0207d77b5

View file

@ -395,6 +395,13 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None,
output_dir = os.path.join(options.output_dir, dirname)
if clean_dir and os.path.exists(output_dir):
shutil.rmtree(output_dir)
# For a dry run, just show our actions as a sanity check
if options.dry_run:
show_actions(series, why_selected, selected, output_dir, options,
board_warnings)
return 0
adjust_cfg = cfgutil.convert_list_to_dict(options.adjust_cfg)
# Drop LOCALVERSION_AUTO since it changes the version string on every commit
@ -425,11 +432,6 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None,
if make_func:
builder.do_make = make_func
# For a dry run, just show our actions as a sanity check
if options.dry_run:
show_actions(series, why_selected, selected, output_dir, options,
board_warnings)
else:
builder.force_build = options.force_build
builder.force_build_failures = options.force_build_failures
builder.force_reconfig = options.force_reconfig