cea-hpc / modules

Environment Modules: provides dynamic modification of a user's environment
http://modules.sourceforge.net/
GNU General Public License v2.0
695 stars 109 forks source link

Wrong result of extra specifier search when module name/version available in several modulepaths #497

Closed xdelaruelle closed 1 year ago

xdelaruelle commented 1 year ago

When a module name/version is available in multiple modulepaths (like foo/1.0 in the below example), if module matches in first modulepath, then the others will also match, even if their content do not match the extra search query.

$ cat /path/to/modulefiles.1/foo/1.0
#%Module
setenv VAR value
$ cat /path/to/modulefiles.2/foo/1.0
#%Module
$ module use /path/to/modulefiles.2
$ module use /path/to/modulefiles.1
$ module avail -t setenv:VAR
/path/to/modulefiles.1:
foo/1.0

/path/to/modulefiles.2:
foo/1.0