Commit e01e8cac authored by gsell's avatar gsell

Pmodules/libmodules.tcl

- better debug output in 'module-addgroup()'
parent 9ea9825e
...@@ -27,7 +27,7 @@ proc module-addgroup { group } { ...@@ -27,7 +27,7 @@ proc module-addgroup { group } {
global name global name
global version global version
debug $group debug "called with arg $group"
set Implementation [file join {*}$::implementation] set Implementation [file join {*}$::implementation]
set GROUP [string toupper $group] set GROUP [string toupper $group]
...@@ -46,25 +46,28 @@ proc module-addgroup { group } { ...@@ -46,25 +46,28 @@ proc module-addgroup { group } {
debug "mode=load: new MODULEPATH=$env(MODULEPATH)" debug "mode=load: new MODULEPATH=$env(MODULEPATH)"
debug "mode=load: new PMODULES_USED_GROUPS=$env(PMODULES_USED_GROUPS)" debug "mode=load: new PMODULES_USED_GROUPS=$env(PMODULES_USED_GROUPS)"
} elseif { [module-info mode remove] } { } elseif { [module-info mode remove] } {
# remove orphan modules
debug "remove orphan modules"
set GROUP [string toupper $group] set GROUP [string toupper $group]
debug "remove hierarchical group '${GROUP}'"
if { [info exists env(PMODULES_LOADED_${GROUP})] } { if { [info exists env(PMODULES_LOADED_${GROUP})] } {
debug "unloading orphan modules"
set modules [split $env(PMODULES_LOADED_${GROUP}) ":"] set modules [split $env(PMODULES_LOADED_${GROUP}) ":"]
foreach m ${modules} { foreach m ${modules} {
if { ${m} == "--APPMARKER--" } { if { ${m} == "--APPMARKER--" } {
continue continue
} }
if { [is-loaded ${module_name}] } { if { [is-loaded ${module_name}] } {
debug "unloading module: $m" debug "unloading: $m"
module unload ${m} module unload ${m}
} }
} }
} else {
debug "no orphan modules to unload"
} }
remove-path MODULEPATH $::PmodulesRoot/$group/$::PmodulesModulfilesDir/$Implementation
remove-path PMODULES_USED_GROUPS $group
debug "mode=remove: $env(MODULEPATH)" debug "mode=remove: $env(MODULEPATH)"
remove-path MODULEPATH $::PmodulesRoot/$group/$::PmodulesModulfilesDir/$Implementation
debug "mode=remove: $env(PMODULES_USED_GROUPS)" debug "mode=remove: $env(PMODULES_USED_GROUPS)"
remove-path PMODULES_USED_GROUPS $group
} }
if { [module-info mode switch2] } { if { [module-info mode switch2] } {
debug "mode=switch2" debug "mode=switch2"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment