mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
buildman: Allow building within a subdir of the current dir
This is useful in some situations, in particular with -w and when building in-tree. Now that we are more careful about what we remove in _PrepareOutputSpace(), it should be safe to relax this restriction. Update the progress information also so it is clear what buildman is doing. Remove files can take a long time. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -85,28 +85,6 @@ def ShowActions(series, why_selected, boards_selected, builder, options,
|
||||
for warning in board_warnings:
|
||||
print(col.Color(col.YELLOW, warning))
|
||||
|
||||
def CheckOutputDir(output_dir):
|
||||
"""Make sure that the output directory is not within the current directory
|
||||
|
||||
If we try to use an output directory which is within the current directory
|
||||
(which is assumed to hold the U-Boot source) we may end up deleting the
|
||||
U-Boot source code. Detect this and print an error in this case.
|
||||
|
||||
Args:
|
||||
output_dir: Output directory path to check
|
||||
"""
|
||||
path = os.path.realpath(output_dir)
|
||||
cwd_path = os.path.realpath('.')
|
||||
while True:
|
||||
if os.path.realpath(path) == cwd_path:
|
||||
Print("Cannot use output directory '%s' since it is within the current directory '%s'" %
|
||||
(path, cwd_path))
|
||||
sys.exit(1)
|
||||
parent = os.path.dirname(path)
|
||||
if parent == path:
|
||||
break
|
||||
path = parent
|
||||
|
||||
def ShowToolchainInfo(boards, toolchains, print_arch, print_prefix):
|
||||
"""Show information about a the tool chain used by one or more boards
|
||||
|
||||
@@ -331,7 +309,6 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
|
||||
output_dir = os.path.join(options.output_dir, dirname)
|
||||
if clean_dir and os.path.exists(output_dir):
|
||||
shutil.rmtree(output_dir)
|
||||
CheckOutputDir(output_dir)
|
||||
builder = Builder(toolchains, output_dir, options.git_dir,
|
||||
options.threads, options.jobs, gnu_make=gnu_make, checkout=True,
|
||||
show_unknown=options.show_unknown, step=options.step,
|
||||
|
Reference in New Issue
Block a user