Skip to content

Commit a0c1816

Browse files
authored
Merge pull request #4736 from Flamefire/patch-1
Avoid making build directory read-only
2 parents b37f707 + ca6be53 commit a0c1816

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

easybuild/framework/easyblock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4324,7 +4324,7 @@ def ensure_writable_log_dir(log_dir):
43244324
adjust_permissions(log_dir, stat.S_IWUSR, add=True, recursive=True)
43254325
else:
43264326
parent_dir = os.path.dirname(log_dir)
4327-
if os.path.exists(parent_dir):
4327+
if os.path.exists(parent_dir) and not (os.stat(parent_dir).st_mode & stat.S_IWUSR):
43284328
adjust_permissions(parent_dir, stat.S_IWUSR, add=True, recursive=False)
43294329
mkdir(log_dir, parents=True)
43304330
adjust_permissions(parent_dir, stat.S_IWUSR, add=False, recursive=False)
@@ -4405,7 +4405,7 @@ def ensure_writable_log_dir(log_dir):
44054405
copy_file(patch['path'], target)
44064406
_log.debug("Copied patch %s to %s", patch['path'], target)
44074407

4408-
if build_option('read_only_installdir'):
4408+
if build_option('read_only_installdir') and not app.cfg['stop']:
44094409
# take away user write permissions (again)
44104410
perms = stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH
44114411
adjust_permissions(new_log_dir, perms, add=False, recursive=True)

0 commit comments

Comments
 (0)