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:
Xavier Delaruelle
2022-08-03 17:18:36 +02:00
parent 77d604b993
commit 9b463ec9af
2 changed files with 9 additions and 0 deletions

View File

@@ -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)]} {

View File

@@ -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]} {