Skip to content

Commit e1bed5f

Browse files
committed
clarify use of both exts_list and components in is_patch_for
1 parent d8c463f commit e1bed5f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

easybuild/tools/github.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,12 +1015,13 @@ def is_patch_for(patch_name, ec):
10151015
patches = copy.copy(ec['patches'])
10161016

10171017
with ec.disable_templating():
1018-
for ext in itertools.chain(ec['exts_list'], ec.get('components', [])):
1019-
if isinstance(ext, (list, tuple)) and len(ext) == 3 and isinstance(ext[2], dict):
1020-
templates = {'name': ext[0], 'version': ext[1]}
1021-
ext_options = ext[2]
1018+
# take into account both list of extensions (via exts_list) and components (cfr. Bundle easyblock)
1019+
for entry in itertools.chain(ec['exts_list'], ec.get('components', [])):
1020+
if isinstance(entry, (list, tuple)) and len(entry) == 3 and isinstance(entry[2], dict):
1021+
templates = {'name': entry[0], 'version': entry[1]}
1022+
options = entry[2]
10221023
patches.extend(p[0] % templates if isinstance(p, (tuple, list)) else p % templates
1023-
for p in ext_options.get('patches', []))
1024+
for p in options.get('patches', []))
10241025

10251026
for patch in patches:
10261027
if isinstance(patch, (tuple, list)):

0 commit comments

Comments
 (0)