diff --git a/rt/modulerc/err.txt b/rt/modulerc/err.txt index cbbd3014f..403d70775 100644 --- a/rt/modulerc/err.txt +++ b/rt/modulerc/err.txt @@ -1348,3 +1348,20 @@ step 113 lua ProjectDIR/src/lmod.in.lua shell --regression_testing load Foo/invisible =========================== module: Foo/invisible isVisible status: false +=========================== +step 114 +lua ProjectDIR/src/lmod.in.lua shell --regression_testing purge +=========================== +=========================== +step 115 +lua ProjectDIR/src/lmod.in.lua shell --regression_testing -A avail +=========================== +ProjectDIR/rt/modulerc/mfG/Core + cluster/A (H) cluster/B (H) cluster/C (H) + Where: + H: Hidden Module +If the avail list is too long consider trying: +"module --default avail" or "ml -d av" to just list the default modules. +"module overview" or "ml ov" to display the number of modules for each name. +Use "module spider" to find all possible modules and extensions. +Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys". diff --git a/rt/modulerc/mfG/Core/cluster/.modulerc.lua b/rt/modulerc/mfG/Core/cluster/.modulerc.lua new file mode 100644 index 000000000..9ae0bc4a0 --- /dev/null +++ b/rt/modulerc/mfG/Core/cluster/.modulerc.lua @@ -0,0 +1,3 @@ +hide_version("cluster/A") +hide_version("cluster/B") +hide_version("cluster/C") diff --git a/rt/modulerc/mfG/Core/.gitignore b/rt/modulerc/mfG/Core/cluster/A.lua similarity index 100% rename from rt/modulerc/mfG/Core/.gitignore rename to rt/modulerc/mfG/Core/cluster/A.lua diff --git a/rt/modulerc/mfG/Core/cluster/B.lua b/rt/modulerc/mfG/Core/cluster/B.lua new file mode 100644 index 000000000..e69de29bb diff --git a/rt/modulerc/mfG/Core/cluster/C.lua b/rt/modulerc/mfG/Core/cluster/C.lua new file mode 100644 index 000000000..e69de29bb diff --git a/rt/modulerc/modulerc.tdesc b/rt/modulerc/modulerc.tdesc index 0dcf835e4..fdb82bc58 100644 --- a/rt/modulerc/modulerc.tdesc +++ b/rt/modulerc/modulerc.tdesc @@ -238,9 +238,9 @@ EOF export MODULEPATH_ROOT=$(testDir)/mfE export MODULEPATH=$MODULEPATH_ROOT/Core cp $(testDir)/isVisibleHook_SitePackage.lua SitePackage.lua - runLmod avail #97 - runLmod -A avail #98 - runLmod load A/1.0 #99 + runLmod avail # 97 + runLmod -A avail # 98 + runLmod load A/1.0 # 99 runLmod load B/3.0 #100 runLmod load F/1.0 #101 runLmod rm F/1.0 #102 @@ -263,6 +263,21 @@ EOF runLmod load xcc #112 runLmod load Foo/invisible #113 + runLmod purge #114 + unsetMT + unset LMOD_MODULERC + rm SitePackage.lua + export MODULEPATH_ROOT=$(testDir)/mfG + export MODULEPATH=$MODULEPATH_ROOT/Core + rm -rf $HOME/.cache + mkdir -p $HOME/.cache/lmod + SED=sed + if [ `uname -s` = Darwin ]; then SED=gsed; fi + $SED -e "s|%testDir%|$(testDir)|g" < $(testDir)/spiderT-old.lua > $HOME/.cache/lmod/spiderT.lua + runLmod -A avail #115 + + + HOME=$ORIG_HOME cat _stdout.[0-9][0-9][0-9] > _stdout.orig diff --git a/rt/modulerc/out.txt b/rt/modulerc/out.txt index 3258cc329..4aaff5d58 100644 --- a/rt/modulerc/out.txt +++ b/rt/modulerc/out.txt @@ -3031,3 +3031,25 @@ MODULEPATH=ProjectDIR/rt/modulerc/mfF/Compiler/xcc/1.0:ProjectDIR/rt/modulerc/mf export MODULEPATH; _ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={Foo={fn="ProjectDIR/rt/modulerc/mfF/Compiler/xcc/1.0/Foo/invisible.lua",fullName="Foo/invisible",loadOrder=2,moduleKindT={kind="hidden",},propT={},stackDepth=0,status="active",userName="Foo/invisible",wV="*invisible.*zfinal",},xcc={actionA={"prepend_path(\"MODULEPATH\",\"ProjectDIR/rt/modulerc/mfF/Compiler/xcc/1.0\")",},fn="ProjectDIR/rt/modulerc/mfF/Core/xcc/1.0.lua",fullName="xcc/1.0",loadOrder=1,propT={},stackDepth=0,status="active",userName="xcc",wV="000000001.*zfinal",},},mpathA={"ProjectDIR/rt/modulerc/mfF/Compiler/xcc/1.0","ProjectDIR/rt/modulerc/mfF/Core",},systemBaseMPATH="ProjectDIR/rt/modulerc/mfF/Core",}'; export _ModuleTable_; +=========================== +step 114 +lua ProjectDIR/src/lmod.in.lua shell --regression_testing purge +=========================== +unset LOADEDMODULES; +__LMOD_REF_COUNT_MODULEPATH=ProjectDIR/rt/modulerc/mfF/Core:1; +export __LMOD_REF_COUNT_MODULEPATH; +MODULEPATH=ProjectDIR/rt/modulerc/mfF/Core; +export MODULEPATH; +unset _LMFILES_; +_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={},mpathA={"ProjectDIR/rt/modulerc/mfF/Core",},systemBaseMPATH="ProjectDIR/rt/modulerc/mfF/Core",}'; +export _ModuleTable_; +=========================== +step 115 +lua ProjectDIR/src/lmod.in.lua shell --regression_testing -A avail +=========================== +__LMOD_REF_COUNT_MODULEPATH=ProjectDIR/rt/modulerc/mfG/Core:1; +export __LMOD_REF_COUNT_MODULEPATH; +MODULEPATH=ProjectDIR/rt/modulerc/mfG/Core; +export MODULEPATH; +_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={},mpathA={"ProjectDIR/rt/modulerc/mfG/Core",},systemBaseMPATH="ProjectDIR/rt/modulerc/mfG/Core",}'; +export _ModuleTable_; diff --git a/rt/modulerc/spiderT-old.lua b/rt/modulerc/spiderT-old.lua new file mode 100644 index 000000000..771d6ba88 --- /dev/null +++ b/rt/modulerc/spiderT-old.lua @@ -0,0 +1,81 @@ +timestampFn = { + false, +} +mrcT = { + alias2modT = {}, + hiddenT = { + ["cluster/A"] = true, + ["cluster/B"] = true, + ["cluster/C"] = true, + }, + version2modT = {}, +} + +mrcMpathT = { + ["%testDir%/mfG/Core"] = { + hiddenT = { + ["cluster/A"] = true, + ["cluster/B"] = true, + ["cluster/C"] = true, + }, + }, +} +spiderT = { + ["%testDir%/mfG/Core"] = { + cluster = { + defaultA = { + { + barefn = ".modulerc.lua", + defaultIdx = 2, + fn = "%testDir%/mfG/Core/cluster/.modulerc.lua", + fullName = "cluster/.modulerc", + luaExt = 10, + mpath = "%testDir%/mfG/Core", + value = false, + }, + }, + defaultT = { + barefn = ".modulerc.lua", + defaultIdx = 2, + fn = "%testDir%/mfG/Core/cluster/.modulerc.lua", + fullName = "cluster/.modulerc", + luaExt = 10, + mpath = "%testDir%/mfG/Core", + value = false, + }, + dirT = {}, + fileT = { + ["cluster/A"] = { + Version = "A", + canonical = "A", + fn = "%testDir%/mfG/Core/cluster/A.lua", + luaExt = 2, + mpath = "%testDir%/mfG/Core", + pV = "*a.*zfinal", + wV = "*a.*zfinal", + }, + ["cluster/B"] = { + Version = "B", + canonical = "B", + fn = "%testDir%/mfG/Core/cluster/B.lua", + luaExt = 2, + mpath = "%testDir%/mfG/Core", + pV = "*b.*zfinal", + wV = "*b.*zfinal", + }, + ["cluster/C"] = { + Version = "C", + canonical = "C", + fn = "%testDir%/mfG/Core/cluster/C.lua", + luaExt = 2, + mpath = "%testDir%/mfG/Core", + pV = "*c.*zfinal", + wV = "*c.*zfinal", + }, + }, + }, + }, + version = 5, +} +mpathMapT = {} + diff --git a/src/MRC.lua b/src/MRC.lua index 3d14a6686..98ba8cb48 100644 --- a/src/MRC.lua +++ b/src/MRC.lua @@ -502,8 +502,13 @@ local function l_find_resultT(self, tbl_kind, replaceT, mpath, wantedA) local wanted = wantedA[i] local key = self:resolve(mpathA, wanted) local ans = ttt[key] or tt[key] - if (ans and type(ans) == "table") then - resultT = ans + if (ans) then + if (type(ans) == "table") then + resultT = ans + else + resultT = replaceT + end + dbg.printT("resultT",resultT) dbg.fini("MRC:l_find_resultT") return resultT end