-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No duplicate entry in resolved modulepath list
When resolving the enabled list of modulepaths, ensure resolved path entries are unique. Fixes #274.
- Loading branch information
1 parent
c83032c
commit 9f5fcb7
Showing
3 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
############################################################################## | ||
# Modules Revision 3.0 | ||
# Providing a flexible user environment | ||
# | ||
# File: modules.90-avail/%M% | ||
# Revision: %I% | ||
# First Edition: 2019/05/15 | ||
# Last Mod.: %U%, %G% | ||
# | ||
# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr | ||
# | ||
# Description: Testuite testsequence | ||
# Command: avail | ||
# Modulefiles: | ||
# Sub-Command: | ||
# | ||
# Comment: %C{ | ||
# Check the module 'avail' command when MODULEPATH variable | ||
# hold duplicate path entries | ||
# }C% | ||
# | ||
############################################################################## | ||
|
||
# set MODULEPATH with multiple entries all pointing to the same directory | ||
setenv_path_var MODULEPATH $modpath:$modpath:$modpath/test/.. | ||
|
||
# single entry should be reported | ||
testouterr_cmd sh {avail -t help/2.0} OK "$modpath:\nhelp/2.0" | ||
testouterr_cmd sh use OK "Search path for module files (in search order):\n $modpath" | ||
|
||
# | ||
# Cleanup | ||
# | ||
|
||
# restore MODULEPATH | ||
setenv_path_var MODULEPATH $modpath | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
############################################################################## | ||
# Modules Revision 3.0 | ||
# Providing a flexible user environment | ||
# | ||
# File: modules.95-version/%M% | ||
# Revision: %I% | ||
# First Edition: 2019/05/15 | ||
# Last Mod.: %U%, %G% | ||
# | ||
# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr | ||
# | ||
# Description: Testuite testsequence | ||
# Command: avail | ||
# Modulefiles: | ||
# Sub-Command: | ||
# | ||
# Comment: %C{ | ||
# Check the module 'avail' command when MODULEPATH variable | ||
# hold path entries using variable reference that all resolve | ||
# to the same directory | ||
# }C% | ||
# | ||
############################################################################## | ||
|
||
# set MODULEPATH with multiple entries all pointing to the same directory | ||
unsetenv_var UNDEFINED | ||
setenv_var DEFINED modulefiles | ||
setenv_path_var MODULEPATH $modpath:$modpath/\$UNDEFINED:$modpath/../\$DEFINED | ||
|
||
# single entry should be reported | ||
testouterr_cmd sh {avail -t help/2.0} OK "$modpath:\nhelp/2.0" | ||
testouterr_cmd sh use OK "Search path for module files (in search order):\n $modpath" | ||
|
||
|
||
# | ||
# Cleanup | ||
# | ||
|
||
# restore environment | ||
setenv_path_var MODULEPATH $modpath | ||
unsetenv_var DEFINED | ||
|