modulecmd: bugfix in unloading modules.

This commit is contained in:
gsell committed 2025-12-04 16:43:33 +01:00
1 parent 24280e921a
commit 9ea687caf3
2 files changed
+6 -6

No files matched your search

+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}"