mirror of
https://github.com/envmodules/modules.git
synced 2026-06-10 00:56:30 +08:00
Unload all matching mods on "module unload" modfile cmd
When conflict_unload and auto_handling options are enabled, a "module unload" modulefile command unloads all loaded modulefiles that match module designation passed as argument. Same behavior than for conflict modulefile command is then obtained. Fixes #215
This commit is contained in:
@@ -1427,7 +1427,17 @@ proc cmdModuleIntUnload {mode args} {
|
||||
# enable auto unload and allow force mode if both auto handling and
|
||||
# conflict unload features are enabled
|
||||
if {[getConf conflict_unload] && [getConf auto_handling]} {
|
||||
set ret [cmdModuleUnload conun match 1 s 0 {*}$args]
|
||||
set conun_mod_list {}
|
||||
foreach conun_arg $args {
|
||||
# unload attempt in reverse load order
|
||||
appendNoDupToList conun_mod_list {*}[lreverse\
|
||||
[getLoadedMatchingName $conun_arg returnall]]
|
||||
}
|
||||
if {[llength $conun_mod_list]} {
|
||||
set ret [cmdModuleUnload conun match 1 s 0 {*}$conun_mod_list]
|
||||
} else {
|
||||
set ret 0
|
||||
}
|
||||
# otherwise module required by others are not unloaded and force mode is
|
||||
# disabled
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user