Hi everyone,
On 21.03.2022 07:29, Michael Klemm wrote:
> On 19.03.2022 14:19, Xavier Delaruelle wrote:
>> Virtual modules [1] seem a good solution for this situation. The idea
>> is to dynamically define the available modulefiles based on the
>> software directories found under the current $ARCH directory.
>
> That sounds like a good way to implement this. Let me try this and see
> if I still have some questions left, but it looks like the ideal
> solution to my problem.
After I saw that Modules >4.7 has module-hide and module-forbid, I went
this way now (after an update of the modules package):
------------ snip ------------
#%Module
set archdir /net/software/$env(ARCH)
set softdir /net/software
set modprefix $softdir/modules/modulefiles
foreach modfile [glob $modprefix/*/*.*] {
regsub ***=/net/software/modules/modulefiles/ $modfile "" mod
if {![file exists $archdir/$mod] && ![file exists $softdir/$mod]} {
module-hide --soft $mod
module-forbid $mod
}
}
------------ snap ------------
Kind regards,
-michael
|