@@ -188,6 +188,7 @@ def __init__(self, ec, logfile=None):
188188
189189 # list of patch/source files, along with checksums
190190 self .patches = []
191+ self .all_patches_paths = set () # set of paths to all patches (including patches of extensions)
191192 self .src = []
192193 self .data_src = []
193194 self .checksums = []
@@ -601,6 +602,7 @@ def fetch_patches(self, patch_specs=None, extension=False, checksums=None):
601602 patch_info ['path' ] = path
602603 patch_info ['checksum' ] = self .get_checksum_for (checksums , filename = patch_info ['name' ], index = index )
603604
605+ self .all_patches_paths .add (path )
604606 if extension :
605607 patches .append (patch_info )
606608 else :
@@ -5126,12 +5128,8 @@ def ensure_writable_log_dir(log_dir):
51265128 block = det_full_ec_version (app .cfg ) + ".block"
51275129 repo .add_easyconfig (ecdict ['original_spec' ], app .name , block , buildstats , currentbuildstats )
51285130 repo .add_easyconfig (spec , app .name , det_full_ec_version (app .cfg ), buildstats , currentbuildstats )
5129- patches = app .patches
5130- for ext in app .exts :
5131- patches += ext .get ('patches' , [])
5132- for patch in patches :
5133- if 'path' in patch :
5134- repo .add_patch (patch ['path' ], app .name )
5131+ for patch_path in app .all_patches_paths :
5132+ repo .add_patch (patch_path , app .name )
51355133 repo .commit ("Built %s" % app .full_mod_name )
51365134 del repo
51375135 except EasyBuildError as err :
@@ -5153,14 +5151,10 @@ def ensure_writable_log_dir(log_dir):
51535151 _log .debug ("Copied easyconfig file %s to %s" , spec , newspec )
51545152
51555153 # copy patches
5156- patches = app .patches
5157- for ext in app .exts :
5158- patches += ext .get ('patches' , [])
5159- for patch in patches :
5160- if 'path' in patch :
5161- target = os .path .join (new_log_dir , os .path .basename (patch ['path' ]))
5162- copy_file (patch ['path' ], target )
5163- _log .debug ("Copied patch %s to %s" , patch ['path' ], target )
5154+ for patch_path in app .all_patches_paths :
5155+ target = os .path .join (new_log_dir , os .path .basename (patch_path ))
5156+ copy_file (patch_path , target )
5157+ _log .debug ("Copied patch %s to %s" , patch_path , target )
51645158
51655159 if build_option ('read_only_installdir' ) and not app .cfg ['stop' ]:
51665160 # take away user write permissions (again)
0 commit comments