While working on #86, I noticed that the module avail <whatever> command always returned 0 for me, even if a module for <whatever> does not exist:
[EESSI pilot 2021.03] $ module avail EasyBuild/4.5.0
No module(s) or extension(s) found!
Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching
any of the "keys".
[EESSI pilot 2021.03] $ echo $?
0
[EESSI pilot 2021.03] $ module avail EasyBuild/4.3.4
/cvmfs/pilot.eessi-hpc.org/2021.03/software/linux/x86_64/intel/haswell/modules/all
EasyBuild/4.3.4
Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching
any of the "keys".
[EESSI pilot 2021.03] $ echo $?
0
[EESSI pilot 2021.03] $ module avail ThisDoesNotExist
No module(s) or extension(s) found!
Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching
any of the "keys".
[EESSI pilot 2021.03] $ echo $?
0
When building a new stack from scratch, you don't notice this, because the $MODULEPATH then still points to a non-existing directory, in which case module avail does return 1:
[EESSI pilot 2021.03] $ export MODULEPATH=/does/not/exist
[EESSI pilot 2021.03] $ module avail EasyBuild
Lmod has detected the following error: module avail is not
possible. MODULEPATH is not set or not set with valid paths.
[EESSI pilot 2021.03] $ echo $?
1
But if you need to update EasyBuild, as was necessary for #86, this is annoying.
A possible solution would be to use module spider or module is-avail.
While working on #86, I noticed that the
module avail <whatever>command always returned 0 for me, even if a module for<whatever>does not exist:When building a new stack from scratch, you don't notice this, because the
$MODULEPATHthen still points to a non-existing directory, in which casemodule availdoes return 1:But if you need to update EasyBuild, as was necessary for #86, this is annoying.
A possible solution would be to use
module spiderormodule is-avail.