summaryrefslogtreecommitdiff
path: root/tools/buildman
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-20 02:48:44 +0300
committerSimon Glass <sjg@chromium.org>2023-07-24 18:34:11 +0300
commit081c34ccdc4c08ac51242d96c51c0b68b7c07828 (patch)
treefe331b27aa100cd037bad0f517d227cbd0f0c8d3 /tools/buildman
parent372b44589f243083ab883358cb7751a5e9f32939 (diff)
downloadu-boot-081c34ccdc4c08ac51242d96c51c0b68b7c07828.tar.xz
buildman: Move output-file setup into one place
Collect the two parts of the output-file handling into single place. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman')
-rw-r--r--tools/buildman/control.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index b6cd9787fb..a9e5b84c4b 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -415,6 +415,13 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None,
if options.work_in_output:
sys.exit(col.build(col.RED, '-w requires that you specify -o'))
output_dir = '..'
+ if options.branch and not options.no_subdirs:
+ # As a special case allow the board directory to be placed in the
+ # output directory itself rather than any subdirectory.
+ dirname = options.branch.replace('/', '_')
+ output_dir = os.path.join(output_dir, dirname)
+ if clean_dir and os.path.exists(output_dir):
+ shutil.rmtree(output_dir)
# Work out what subset of the boards we are building
if not brds:
@@ -461,14 +468,6 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None,
options.branch)
# Create a new builder with the selected options.
- if options.branch:
- dirname = options.branch.replace('/', '_')
- # As a special case allow the board directory to be placed in the
- # output directory itself rather than any subdirectory.
- if not options.no_subdirs:
- output_dir = os.path.join(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: