aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-19 17:48:58 -0600
committerSimon Glass <sjg@chromium.org>2023-07-24 09:34:11 -0600
commit75584e1fa7f545c88a67b512e85c3ad59cd921d1 (patch)
tree6e3cdb45960fed9919adca21e0c62eafa0e4b390
parenta659b8dcd47026a26604f6947a456d7fe453b55a (diff)
downloadu-boot-75584e1fa7f545c88a67b512e85c3ad59cd921d1.zip
u-boot-75584e1fa7f545c88a67b512e85c3ad59cd921d1.tar.gz
u-boot-75584e1fa7f545c88a67b512e85c3ad59cd921d1.tar.bz2
buildman: Move getting the adjust_cfg into run_builder()
Move this into its own function to reduce the size of do_buildman(). Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--tools/buildman/control.py38
1 files changed, 27 insertions, 11 deletions
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 1317cc7..a20fa62 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -515,6 +515,31 @@ def run_builder(builder, commits, board_selected, options):
return 101
return 0
+
+def calc_adjust_cfg(adjust_cfg, reproducible_builds):
+ """Calculate the value to use for adjust_cfg
+
+ Args:
+ adjust_cfg (list of str): List of configuration changes. See cfgutil for
+ details
+ reproducible_builds (bool): True to adjust the configuration to get
+ reproduceable builds
+
+ Returns:
+ adjust_cfg (list of str): List of configuration changes
+ """
+ adjust_cfg = cfgutil.convert_list_to_dict(adjust_cfg)
+
+ # Drop LOCALVERSION_AUTO since it changes the version string on every commit
+ if reproducible_builds:
+ # If these are mentioned, leave the local version alone
+ if 'LOCALVERSION' in adjust_cfg or 'LOCALVERSION_AUTO' in adjust_cfg:
+ print('Not dropping LOCALVERSION_AUTO for reproducible build')
+ else:
+ adjust_cfg['LOCALVERSION_AUTO'] = '~'
+ return adjust_cfg
+
+
def do_buildman(options, args, toolchains=None, make_func=None, brds=None,
clean_dir=False, test_thread_exceptions=False):
"""The main control code for buildman
@@ -582,16 +607,6 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None,
options.no_allow_missing, len(selected),
options.branch)
- adjust_cfg = cfgutil.convert_list_to_dict(options.adjust_cfg)
-
- # Drop LOCALVERSION_AUTO since it changes the version string on every commit
- if options.reproducible_builds:
- # If these are mentioned, leave the local version alone
- if 'LOCALVERSION' in adjust_cfg or 'LOCALVERSION_AUTO' in adjust_cfg:
- print('Not dropping LOCALVERSION_AUTO for reproducible build')
- else:
- adjust_cfg['LOCALVERSION_AUTO'] = '~'
-
# Create a new builder with the selected options
builder = Builder(toolchains, output_dir, git_dir,
options.threads, options.jobs, checkout=True,
@@ -605,7 +620,8 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None,
warnings_as_errors=options.warnings_as_errors,
work_in_output=options.work_in_output,
test_thread_exceptions=test_thread_exceptions,
- adjust_cfg=adjust_cfg,
+ adjust_cfg=calc_adjust_cfg(options.adjust_cfg,
+ options.reproducible_builds),
allow_missing=allow_missing, no_lto=options.no_lto,
reproducible_builds=options.reproducible_builds,
force_build = options.force_build,