Merge pull request #1341 from Pmodules/1340-modulecmd-check-whether-a-module-is-loaded-or-not-is-buggy

modulecmd: bugfix in unloading modules.
This commit is contained in:
2025-12-04 16:45:30 +01:00
committed by GitHub
2 changed files with 6 additions and 6 deletions
+3
View File
@@ -3,6 +3,9 @@
## Version 2.0.3
### modulecmd
* Bugfix in unloading modules. Under certain conditions unloading a module
failed due to a wrong check in the test whether a module is loaded or not.
(#1340)
* Misleading error message fixed if system configuration file is not readable.
(#1316, #1331)
+3 -6
View File
@@ -1073,13 +1073,10 @@ subcommand_unload() {
for arg in "${args[@]}"; do
# is the module loaded?
for lmfile in "${_lmfiles_[@]}" '_zzzz_'; do
if [[ $lmfile =~ ${arg} ]]; then
break
fi
[[ /${lmfile} =~ /${arg}$ ]] && break
done
if [[ "${lmfile}" == '_zzzz_' ]]; then
continue
fi
[[ "${lmfile}" == '_zzzz_' ]] && continue
# yes, module has been loaded
is_modulefile modulecmd "${lmfile}" || die_module_not_a_modulefile "${arg}"