From 6205acc49e51fe2338a2198dc953ea16f423f74b Mon Sep 17 00:00:00 2001 From: Yuliang Wang Date: Thu, 21 Nov 2024 12:25:11 +0000 Subject: [PATCH] config: Fix recursive artifact resolution A previous change altered the config normalisation pass such that each artifact field becomes a dictionary containing multiple properties rather than a single string. This was not fully taken into account by the resolution step, which resulted in recursive artifacts not being correctly resolved. Fixed by properly constructing "artifact_lut". Fixes: 8a368fb5 ("config: Allow artifacts to be omitted from final copy stage") Signed-off-by: Yuliang Wang --- shrinkwrap/utils/config.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/shrinkwrap/utils/config.py b/shrinkwrap/utils/config.py index 1d044af..2f77d8d 100644 --- a/shrinkwrap/utils/config.py +++ b/shrinkwrap/utils/config.py @@ -496,10 +496,9 @@ def resolveb(config, btvars={}, clivars={}): def _resolve_artifact_map(config): def _combine(config): - artifact_map = {} - for desc in config['build'].values(): - artifact_map.update(desc['artifacts'].items()) - return {'artifact': artifact_map} + return { 'artifact': { k: v['path'] + for desc in config['build'].values() + for k, v in desc['artifacts'].items() } } def _normalize_basename(path): return os.path.basename(os.path.normpath(path)) @@ -529,7 +528,6 @@ def resolveb(config, btvars={}, clivars={}): for desc in config['build'].values(): for v in desc['artifacts'].values(): v['path'] = _string_substitute(v['path'], artifact_lut, False) - v['base'] = _string_substitute(v['base'], artifact_lut, False) if artifact_nr > 0: artifact_lut = _combine(config) -- GitLab