aboutsummaryrefslogtreecommitdiff
path: root/tools/buildman
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-19 17:49:27 -0600
committerSimon Glass <sjg@chromium.org>2023-07-24 09:34:11 -0600
commit2ecc5805ac5e9209b922f57a39cb54bc648c1a22 (patch)
tree083ddbc5102b3fe0e6b3e35212dd689658cfab40 /tools/buildman
parent236f95938609e584fce7ac7c03f659c8fa2bec6c (diff)
downloadu-boot-2ecc5805ac5e9209b922f57a39cb54bc648c1a22.zip
u-boot-2ecc5805ac5e9209b922f57a39cb54bc648c1a22.tar.gz
u-boot-2ecc5805ac5e9209b922f57a39cb54bc648c1a22.tar.bz2
buildman: Move copy_files() out ot BuilderThread class
This does not need to be in the class. Move it out to avoid a pylint warning. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman')
-rw-r--r--tools/buildman/builderthread.py47
1 files changed, 24 insertions, 23 deletions
diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
index ed84a0f..25f460c 100644
--- a/tools/buildman/builderthread.py
+++ b/tools/buildman/builderthread.py
@@ -64,6 +64,27 @@ def _remove_old_outputs(out_dir):
os.remove(fname)
+def copy_files(out_dir, build_dir, dirname, patterns):
+ """Copy files from the build directory to the output.
+
+ Args:
+ out_dir (str): Path to output directory containing the files
+ build_dir (str): Place to copy the files
+ dirname (str): Source directory, '' for normal U-Boot, 'spl' for SPL
+ patterns (list of str): A list of filenames to copy, each relative
+ to the build directory
+ """
+ for pattern in patterns:
+ file_list = glob.glob(os.path.join(out_dir, dirname, pattern))
+ for fname in file_list:
+ target = os.path.basename(fname)
+ if dirname:
+ base, ext = os.path.splitext(target)
+ if ext:
+ target = f'{base}-{dirname}{ext}'
+ shutil.copy(fname, os.path.join(build_dir, target))
+
+
# pylint: disable=R0903
class BuilderJob:
"""Holds information about a job to be performed by a thread
@@ -592,7 +613,7 @@ class BuilderThread(threading.Thread):
capture_stderr=True, cwd=result.out_dir,
raise_on_error=False, env=env)
if not work_in_output:
- self.copy_files(result.out_dir, build_dir, '', ['uboot.env'])
+ copy_files(result.out_dir, build_dir, '', ['uboot.env'])
# Write out the image sizes file. This is similar to the output
# of binutil's 'size' utility, but it omits the header line and
@@ -607,7 +628,7 @@ class BuilderThread(threading.Thread):
if not work_in_output:
# Write out the configuration files, with a special case for SPL
for dirname in ['', 'spl', 'tpl']:
- self.copy_files(
+ copy_files(
result.out_dir, build_dir, dirname,
['u-boot.cfg', 'spl/u-boot-spl.cfg', 'tpl/u-boot-tpl.cfg',
'.config', 'include/autoconf.mk',
@@ -615,31 +636,11 @@ class BuilderThread(threading.Thread):
# Now write the actual build output
if keep_outputs:
- self.copy_files(
+ copy_files(
result.out_dir, build_dir, '',
['u-boot*', '*.bin', '*.map', '*.img', 'MLO', 'SPL',
'include/autoconf.mk', 'spl/u-boot-spl*'])
- def copy_files(self, out_dir, build_dir, dirname, patterns):
- """Copy files from the build directory to the output.
-
- Args:
- out_dir (str): Path to output directory containing the files
- build_dir (str): Place to copy the files
- dirname (str): Source directory, '' for normal U-Boot, 'spl' for SPL
- patterns (list of str): A list of filenames to copy, each relative
- to the build directory
- """
- for pattern in patterns:
- file_list = glob.glob(os.path.join(out_dir, dirname, pattern))
- for fname in file_list:
- target = os.path.basename(fname)
- if dirname:
- base, ext = os.path.splitext(target)
- if ext:
- target = f'{base}-{dirname}{ext}'
- shutil.copy(fname, os.path.join(build_dir, target))
-
def _send_result(self, result):
"""Send a result to the builder for processing