From 7bf7986d645579be341864159dff9dfa66d14d22 Mon Sep 17 00:00:00 2001 From: Ryan Roberts Date: Thu, 29 Feb 2024 17:15:09 +0000 Subject: [PATCH] config: Allow buildex params from overlays Previously, build/clean/process were all spec'ed to merge only the build and run sections from any overlays. I believe this was intended to allow future additions to the config to not cause issues (e.g. if a 'configure' command and section was ever added, it doesn't make sense to pull that into a build since configure has to have already happened). However when 'buildex' was added as a back compat extension for the build section, it was not treated as part of the build section and erroneously filtered out. Let's fix that. Signed-off-by: Ryan Roberts --- shrinkwrap/commands/buildall.py | 8 ++++---- shrinkwrap/commands/clean.py | 8 ++++---- shrinkwrap/commands/process.py | 13 +++++++++---- shrinkwrap/utils/config.py | 6 +++++- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/shrinkwrap/commands/buildall.py b/shrinkwrap/commands/buildall.py index a7677d0..d5219cc 100644 --- a/shrinkwrap/commands/buildall.py +++ b/shrinkwrap/commands/buildall.py @@ -60,10 +60,10 @@ def add_common_args(cmdp): metavar='cfgfile', required=False, default=[], action='append', help="""Optional config file overlay to override run-time and - build-time settings. Only entries within the "build" and - "run" sections are used. Applied to all configs being - built. Can be specified multiple times; left-most overlay - is the first overlay applied.""") + build-time settings. Only entries within the "build", + "buildex" and "run" sections are used. Applied to all + configs being built. Can be specified multiple times; + left-most overlay is the first overlay applied.""") cmdp.add_argument('-t', '--tasks', required=False, default=dflt_jobs(), metavar='count', type=int, diff --git a/shrinkwrap/commands/clean.py b/shrinkwrap/commands/clean.py index 6dd2172..8089c07 100644 --- a/shrinkwrap/commands/clean.py +++ b/shrinkwrap/commands/clean.py @@ -39,10 +39,10 @@ def add_parser(parser, formatter): metavar='cfgfile', required=False, default=[], action='append', help="""Optional config file overlay to override run-time and - build-time settings. Only entries within the "build" and - "run" sections are used. Applied to all configs being - built. Can be specified multiple times; left-most overlay - is the first overlay applied.""") + build-time settings. Only entries within the "build", + "buildex" and "run" sections are used. Applied to all + configs being built. Can be specified multiple times; + left-most overlay is the first overlay applied.""") cmdp.add_argument('-t', '--tasks', required=False, default=dflt_jobs(), metavar='count', type=int, diff --git a/shrinkwrap/commands/process.py b/shrinkwrap/commands/process.py index 046829a..3b9dddb 100644 --- a/shrinkwrap/commands/process.py +++ b/shrinkwrap/commands/process.py @@ -44,9 +44,10 @@ def add_parser(parser, formatter): metavar='cfgfile', required=False, default=[], action='append', help="""Optional config file overlay to override run-time and - build-time settings. Only entries within the "build" and - "run" sections are used. Can be specified multiple times; - left-most overlay is the first overlay applied.""") + build-time settings. Only entries within the "build", + "buildex" and "run" sections are used. Can be specified + multiple times; left-most overlay is the first overlay + applied.""") cmdp.add_argument('-b', '--btvar', metavar='key=value', required=False, default=[], @@ -79,7 +80,11 @@ def dispatch(args): for overlayname in args.overlay: overlay = config.filename(overlayname) overlay = config.load(overlay) - overlay = {'build': overlay['build'], 'run': overlay['run']} + overlay = { + 'build': overlay['build'], + 'buildex': overlay['buildex'], + 'run': overlay['run'], + } overlays.append(overlay) filename = config.filename(args.config) diff --git a/shrinkwrap/utils/config.py b/shrinkwrap/utils/config.py index d55086c..46e1907 100644 --- a/shrinkwrap/utils/config.py +++ b/shrinkwrap/utils/config.py @@ -719,7 +719,11 @@ def load_all(names, overlaynames=[]): for overlayname in overlaynames: overlay = filename(overlayname) overlay = load(overlay) - overlay = {'build': overlay['build'], 'run': overlay['run']} + overlay = { + 'build': overlay['build'], + 'buildex': overlay['buildex'], + 'run': overlay['run'], + } overlays.append(overlay) for name in names: -- GitLab