Skip to content

Commit c2fbf16

Browse files
committed
Keep list of patches unique before attempting a copy
1 parent 0caac31 commit c2fbf16

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

easybuild/framework/easyblock.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5128,7 +5128,9 @@ def ensure_writable_log_dir(log_dir):
51285128
repo.add_easyconfig(spec, app.name, det_full_ec_version(app.cfg), buildstats, currentbuildstats)
51295129
patches = app.patches
51305130
for ext in app.exts:
5131-
patches += ext.get('patches', [])
5131+
for patch in ext.get('patches', []):
5132+
if patch not in patches:
5133+
patches.append(patch)
51325134
for patch in patches:
51335135
if 'path' in patch:
51345136
repo.add_patch(patch['path'], app.name)
@@ -5145,23 +5147,25 @@ def ensure_writable_log_dir(log_dir):
51455147
else:
51465148
log_fn = os.path.basename(get_log_filename(app.name, app.version))
51475149
try:
5148-
application_log = os.path.join(new_log_dir, log_fn)
5149-
move_logs(app.logfile, application_log)
5150-
51515150
newspec = os.path.join(new_log_dir, app.cfg.filename())
51525151
copy_file(spec, newspec)
51535152
_log.debug("Copied easyconfig file %s to %s", spec, newspec)
51545153

51555154
# copy patches
51565155
patches = app.patches
51575156
for ext in app.exts:
5158-
patches += ext.get('patches', [])
5157+
for patch in ext.get('patches', []):
5158+
if patch not in patches:
5159+
patches.append(patch)
51595160
for patch in patches:
51605161
if 'path' in patch:
51615162
target = os.path.join(new_log_dir, os.path.basename(patch['path']))
51625163
copy_file(patch['path'], target)
51635164
_log.debug("Copied patch %s to %s", patch['path'], target)
51645165

5166+
application_log = os.path.join(new_log_dir, log_fn)
5167+
move_logs(app.logfile, application_log)
5168+
51655169
if build_option('read_only_installdir') and not app.cfg['stop']:
51665170
# take away user write permissions (again)
51675171
perms = stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH

0 commit comments

Comments
 (0)