mirror of
https://github.com/envmodules/modules.git
synced 2026-06-18 00:06:53 +08:00
Update *versions* modulefiles generated when --enable-versioning
installation option is set: fix `module unload` commands in these
modulefiles to avoid defining a conflict toward module to unload.
These *versions* modulefiles are broken since Modules 4.2, where the
automated module handling feature has been added.
Existing *versions* modulefiles for Modules 4.2 and upward should be
fixed with the following kind of script:
```
for i in /usr/local/Modules/versions/*; do
version=$(basename "$i")
version=$i
major=${version:0:1}
minor=${version:2:1}
if [[ "$major" -gt 4 || ("$major" -eq 4 && "$minor" -gt 1) ]]; then
sed -i "s|module unload|module unload --not-req|" "$i"
fi
done
```
Fixes 531