diff --git a/modulecmd.tcl.in b/modulecmd.tcl.in index 487abfd8..7534b0dc 100644 --- a/modulecmd.tcl.in +++ b/modulecmd.tcl.in @@ -1764,7 +1764,7 @@ proc setModuleResolution {mod target {symver {}} {override_res_path 1}} { # find end-point module and register step-by-step path to get to it set res $target - set res_path $res + lappend res_path $res while {$mod ne $res && [info exists g_resolvedPath($res)]} { set res $g_resolvedPath($res) lappend res_path $res diff --git a/testsuite/modulefiles.path1/loc_dv10/.version b/testsuite/modulefiles.path1/loc_dv10/.version new file mode 100644 index 00000000..02a317da --- /dev/null +++ b/testsuite/modulefiles.path1/loc_dv10/.version @@ -0,0 +1,2 @@ +#%Module +set ModulesVersion {no default} diff --git a/testsuite/modulefiles.path1/loc_dv10/1.1 b/testsuite/modulefiles.path1/loc_dv10/1.1 new file mode 100644 index 00000000..1c148cdd --- /dev/null +++ b/testsuite/modulefiles.path1/loc_dv10/1.1 @@ -0,0 +1 @@ +#%Module diff --git a/testsuite/modulefiles.path2/loc_dv10/.version b/testsuite/modulefiles.path2/loc_dv10/.version new file mode 100644 index 00000000..02a317da --- /dev/null +++ b/testsuite/modulefiles.path2/loc_dv10/.version @@ -0,0 +1,2 @@ +#%Module +set ModulesVersion {no default} diff --git a/testsuite/modulefiles.path2/loc_dv10/1.2 b/testsuite/modulefiles.path2/loc_dv10/1.2 new file mode 100644 index 00000000..1c148cdd --- /dev/null +++ b/testsuite/modulefiles.path2/loc_dv10/1.2 @@ -0,0 +1 @@ +#%Module diff --git a/testsuite/modules.20-locate/069-cross.exp b/testsuite/modules.20-locate/069-cross.exp index a2100cb9..746f9021 100644 --- a/testsuite/modules.20-locate/069-cross.exp +++ b/testsuite/modules.20-locate/069-cross.exp @@ -572,6 +572,15 @@ for {set i 42} {$i <= 49} {incr i} { cross_test_case $i } + +# test default symbol targetting a modulefile version with a whitespace in the name, +# multiple versions of the module found in several modulepaths +setenv_var MODULES_AVAIL_INDEPTH 1 +testouterr_cmd sh {avail -t loc_dv10} OK "$modpath1:\nloc_dv10/1.1\n\n$modpath2:\nloc_dv10/1.2" +testouterr_cmd sh {load loc_dv10} ERR "$err_path'loc_dv10/no default'" +unsetenv_var MODULES_AVAIL_INDEPTH + + # # Cleanup #