Skip to content

Commit eb07c72

Browse files
committed
Change into builddir when extracting multiple sources
For compatibility with the previous version only. `find_base_dir` in `extract_file` couldn't find the base dir for subsequent sources so fell back to the parent directory which is the builddir in this case
1 parent c0b91e0 commit eb07c72

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

easybuild/framework/easyblock.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2852,15 +2852,19 @@ def extract_step(self):
28522852
"""
28532853
Unpack the source files.
28542854
"""
2855-
for src in self.src:
2855+
for i, src in enumerate(self.src):
28562856
self.log.info("Unpacking source %s" % src['name'])
28572857
srcdir = extract_file(src['path'], self.builddir, cmd=src['cmd'],
2858-
extra_options=self.cfg['unpack_options'], change_into_dir=False)
2859-
change_dir(srcdir)
2858+
extra_options=self.cfg['unpack_options'], change_into_dir=(i == 0))
28602859
if srcdir:
28612860
self.src[self.src.index(src)]['finalpath'] = srcdir
28622861
else:
28632862
raise EasyBuildError("Unpacking source %s failed", src['name'])
2863+
# Compatibility with previous EasyBuild versions:
2864+
# When multiple sources were extracted subsequent calls of `extract_file` returned the build directory
2865+
# so we changed to that instead of the directory of the first/main source
2866+
if len(src) > 1:
2867+
change_dir(self.builddir)
28642868

28652869
def patch_step(self, beginpath=None, patches=None):
28662870
"""

0 commit comments

Comments
 (0)