Skip to content

Commit 839b1f3

Browse files
authored
Merge pull request #3634 from lexming/modload-gromacs
enhance `get_lib_subdirs` in GROMACS easyblock to avoid symlinked paths
2 parents 3dcd714 + c03678e commit 839b1f3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

easybuild/easyblocks/g/gromacs.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,10 @@ def get_lib_subdirs(self):
569569
libname = f'libgromacs*.{self.libext}'
570570

571571
lib_subdirs = []
572-
for lib_path in glob.glob(os.path.join(self.installdir, '**', libname)):
573-
# generate relative path from installdir to subdir of libname
574-
lib_relpath = lib_path[len(self.installdir) + 1:]
572+
real_installdir = os.path.realpath(self.installdir)
573+
for lib_path in glob.glob(os.path.join(real_installdir, '**', libname)):
574+
lib_relpath = os.path.realpath(lib_path) # avoid symlinks
575+
lib_relpath = lib_relpath[len(real_installdir) + 1:] # relative path from installdir
575576
subdir = lib_relpath.split(os.sep)[0:-1]
576577
lib_subdirs.append(os.path.join(*subdir))
577578

0 commit comments

Comments
 (0)