mirror of
https://github.com/envmodules/modules.git
synced 2026-06-18 00:06:53 +08:00
Unset mod spec on source subcmd if file exists
In case module specification corresponds to a full path name file, unset parsed module specification on source sub-command. It is done not to confuse specific character in file path name (like '+') with module variant specification.
This commit is contained in:
@@ -1490,6 +1490,12 @@ proc getModuleVersSpec {modarg} {
|
||||
}
|
||||
}
|
||||
|
||||
proc unsetModuleVersSpec {modarg} {
|
||||
if {[info exists ::g_moduleVersSpec($modarg)]} {
|
||||
unset ::g_moduleVersSpec($modarg)
|
||||
}
|
||||
}
|
||||
|
||||
# get module name from module name and version spec if parsed
|
||||
proc getModuleNameFromVersSpec {modarg} {
|
||||
if {[info exists ::g_moduleVersSpec($modarg)]} {
|
||||
|
||||
@@ -814,6 +814,9 @@ proc cmdModuleSource {mode args} {
|
||||
set modfile $absfpath
|
||||
set modname $absfpath
|
||||
set modnamevr $absfpath
|
||||
# unset module specification not to confuse specific char in file
|
||||
# path (like '+') with variant specification
|
||||
unsetModuleVersSpec $mod
|
||||
set mod $absfpath
|
||||
# if not a path specification, try to resolve a modulefile
|
||||
} elseif {![isModuleFullPath $rawarg]} {
|
||||
|
||||
Reference in New Issue
Block a user