From a0a2948bb94844867db1a06c9fbb9128b858cbfb Mon Sep 17 00:00:00 2001 From: Robert McLay Date: Sat, 10 Aug 2024 14:21:49 -0600 Subject: [PATCH] Issue #690: added hidden module support for load(between()) --- rt/between/between.tdesc | 2 ++ rt/between/err.txt | 12 +++++++++++- rt/between/mf/Core/Me.lua | 3 +++ rt/between/mf/Core/d/.modulerc.lua | 1 + rt/between/mf/Core/d/1.0.lua | 0 rt/between/mf/Core/d/1.1.lua | 0 rt/between/mf/Core/d/1.2.lua | 0 rt/between/mf/Core/d/1.3.lua | 0 rt/between/mf/Core/d/1.4.lua | 0 rt/between/mf/Core/d/1.5.lua | 0 rt/between/mf/Core/e/.modulerc.lua | 2 ++ rt/between/mf/Core/e/1.0.lua | 0 rt/between/mf/Core/e/1.1.lua | 0 rt/between/mf/Core/e/1.2.lua | 0 rt/between/mf/Core/e/1.3.lua | 0 rt/between/mf/Core/e/1.4.lua | 0 rt/between/mf/Core/e/1.5.lua | 0 rt/between/out.txt | 20 ++++++++++++++++++++ src/MName.lua | 18 +++++++----------- 19 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 rt/between/mf/Core/Me.lua create mode 100644 rt/between/mf/Core/d/.modulerc.lua create mode 100644 rt/between/mf/Core/d/1.0.lua create mode 100644 rt/between/mf/Core/d/1.1.lua create mode 100644 rt/between/mf/Core/d/1.2.lua create mode 100644 rt/between/mf/Core/d/1.3.lua create mode 100644 rt/between/mf/Core/d/1.4.lua create mode 100644 rt/between/mf/Core/d/1.5.lua create mode 100644 rt/between/mf/Core/e/.modulerc.lua create mode 100644 rt/between/mf/Core/e/1.0.lua create mode 100644 rt/between/mf/Core/e/1.1.lua create mode 100644 rt/between/mf/Core/e/1.2.lua create mode 100644 rt/between/mf/Core/e/1.3.lua create mode 100644 rt/between/mf/Core/e/1.4.lua create mode 100644 rt/between/mf/Core/e/1.5.lua diff --git a/rt/between/between.tdesc b/rt/between/between.tdesc index 3f3326e75..fc69f29f7 100644 --- a/rt/between/between.tdesc +++ b/rt/between/between.tdesc @@ -49,6 +49,8 @@ testdescript = { runLmod load a/1.1 Mb #23 runLmod load Mc #24 runLmod load Md #25 + runLmod load Me #26 + runLmod list #27 HOME=$ORIG_HOME cat _stdout.[0-9][0-9][0-9] > _stdout.orig diff --git a/rt/between/err.txt b/rt/between/err.txt index 5f70bf284..b307759bd 100644 --- a/rt/between/err.txt +++ b/rt/between/err.txt @@ -2,7 +2,7 @@ step 1 lua ProjectDIR/src/lmod.in.lua shell --regression_testing --version =========================== -Modules based on Lua: Version 8.6.9 2022-02-02 11:25 -04:00 +Modules based on Lua: Version 8.7.47 2024-07-22 10:04 -04:00 by Robert McLay mclay@tacc.utexas.edu =========================== step 2 @@ -163,3 +163,13 @@ Lmod has detected the following error: These module(s) or extension(s) exist but Executing this command requires loading "a" which failed while processing the following module(s): Module fullname Module Filename Md ProjectDIR/rt/between/mf/Core/Md.lua +=========================== +step 26 +lua ProjectDIR/src/lmod.in.lua shell --regression_testing load Me +=========================== +=========================== +step 27 +lua ProjectDIR/src/lmod.in.lua shell --regression_testing list +=========================== +Currently Loaded Modules: + 1) b/1.4 2) M9 3) a/1.1 4) Mb 5) d/1.3 6) e/1.2 7) Me diff --git a/rt/between/mf/Core/Me.lua b/rt/between/mf/Core/Me.lua new file mode 100644 index 000000000..9e27462d8 --- /dev/null +++ b/rt/between/mf/Core/Me.lua @@ -0,0 +1,3 @@ +load(between("d","1.1<","<1.5")) +load(between("e","1.1<","1.5")) + diff --git a/rt/between/mf/Core/d/.modulerc.lua b/rt/between/mf/Core/d/.modulerc.lua new file mode 100644 index 000000000..00d9d39aa --- /dev/null +++ b/rt/between/mf/Core/d/.modulerc.lua @@ -0,0 +1 @@ +hide_version("d/1.4") diff --git a/rt/between/mf/Core/d/1.0.lua b/rt/between/mf/Core/d/1.0.lua new file mode 100644 index 000000000..e69de29bb diff --git a/rt/between/mf/Core/d/1.1.lua b/rt/between/mf/Core/d/1.1.lua new file mode 100644 index 000000000..e69de29bb diff --git a/rt/between/mf/Core/d/1.2.lua b/rt/between/mf/Core/d/1.2.lua new file mode 100644 index 000000000..e69de29bb diff --git a/rt/between/mf/Core/d/1.3.lua b/rt/between/mf/Core/d/1.3.lua new file mode 100644 index 000000000..e69de29bb diff --git a/rt/between/mf/Core/d/1.4.lua b/rt/between/mf/Core/d/1.4.lua new file mode 100644 index 000000000..e69de29bb diff --git a/rt/between/mf/Core/d/1.5.lua b/rt/between/mf/Core/d/1.5.lua new file mode 100644 index 000000000..e69de29bb diff --git a/rt/between/mf/Core/e/.modulerc.lua b/rt/between/mf/Core/e/.modulerc.lua new file mode 100644 index 000000000..9efca05f1 --- /dev/null +++ b/rt/between/mf/Core/e/.modulerc.lua @@ -0,0 +1,2 @@ +hide_version("d/1.4") +module_version("e/1.2","default") diff --git a/rt/between/mf/Core/e/1.0.lua b/rt/between/mf/Core/e/1.0.lua new file mode 100644 index 000000000..e69de29bb diff --git a/rt/between/mf/Core/e/1.1.lua b/rt/between/mf/Core/e/1.1.lua new file mode 100644 index 000000000..e69de29bb diff --git a/rt/between/mf/Core/e/1.2.lua b/rt/between/mf/Core/e/1.2.lua new file mode 100644 index 000000000..e69de29bb diff --git a/rt/between/mf/Core/e/1.3.lua b/rt/between/mf/Core/e/1.3.lua new file mode 100644 index 000000000..e69de29bb diff --git a/rt/between/mf/Core/e/1.4.lua b/rt/between/mf/Core/e/1.4.lua new file mode 100644 index 000000000..e69de29bb diff --git a/rt/between/mf/Core/e/1.5.lua b/rt/between/mf/Core/e/1.5.lua new file mode 100644 index 000000000..e69de29bb diff --git a/rt/between/out.txt b/rt/between/out.txt index 567971a2d..1afe08262 100644 --- a/rt/between/out.txt +++ b/rt/between/out.txt @@ -238,3 +238,23 @@ step 25 lua ProjectDIR/src/lmod.in.lua shell --regression_testing load Md =========================== false +=========================== +step 26 +lua ProjectDIR/src/lmod.in.lua shell --regression_testing load Me +=========================== +LOADEDMODULES=b/1.4:M9:a/1.1:Mb:d/1.3:e/1.2:Me; +export LOADEDMODULES; +MODULEPATH=ProjectDIR/rt/between/mf/Core; +export MODULEPATH; +_LMFILES_=ProjectDIR/rt/between/mf/Core/b/1.4.lua:ProjectDIR/rt/between/mf/Core/M9.lua:ProjectDIR/rt/between/mf/Core/a/1.1.lua:ProjectDIR/rt/between/mf/Core/Mb.lua:ProjectDIR/rt/between/mf/Core/d/1.3.lua:ProjectDIR/rt/between/mf/Core/e/1.2.lua:ProjectDIR/rt/between/mf/Core/Me.lua; +export _LMFILES_; +_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={M9={fn="ProjectDIR/rt/between/mf/Core/M9.lua",fullName="M9",loadOrder=2,propT={},stackDepth=0,status="active",userName="M9",wV="M.*zfinal",},Mb={fn="ProjectDIR/rt/between/mf/Core/Mb.lua",fullName="Mb",loadOrder=4,propT={},stackDepth=0,status="active",userName="Mb",wV="M.*zfinal",},Me={fn="ProjectDIR/rt/between/mf/Core/Me.lua",fullName="Me",loadOrder=7,propT={},stackDepth=0,status="active",userName="Me",wV="M.*zfinal",},a={fn="ProjectDIR/rt/between/mf/Core/a/1.1.lua",fullName="a/1.1",loadOrder=3,propT={},stackDepth=0,status="active",userName="a/1.1",wV="000000001.000000001.*zfinal",},b={fn="ProjectDIR/rt/between/mf/Core/b/1.4.lua",fullName="b/1.4",loadOrder=1,propT={},stackDepth=1,status="active",userName="b/1.4",wV="000000001.000000004.*zfinal",},d={fn="ProjectDIR/rt/between/mf/Core/d/1.3.lua",fullName="d/1.3",loadOrder=5,propT={},stackDepth=1,status="active",userName="d/1.3",wV="000000001.000000003.*zfinal",},e={fn="ProjectDIR/rt/between/mf/Core/e/1.2.lua",fullName="e/1.2",loadOrder=6,propT={},stackDepth=1,status="active",userName="e/1.2",wV="^00000001.000000002.*zfinal",},},mpathA={"ProjectDIR/rt/between/mf/Core",},systemBaseMPATH="ProjectDIR/rt/between/mf/Core",}'; +export _ModuleTable_; +=========================== +step 27 +lua ProjectDIR/src/lmod.in.lua shell --regression_testing list +=========================== +MODULEPATH=ProjectDIR/rt/between/mf/Core; +export MODULEPATH; +_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={M9={fn="ProjectDIR/rt/between/mf/Core/M9.lua",fullName="M9",loadOrder=2,propT={},stackDepth=0,status="active",userName="M9",wV="M.*zfinal",},Mb={fn="ProjectDIR/rt/between/mf/Core/Mb.lua",fullName="Mb",loadOrder=4,propT={},stackDepth=0,status="active",userName="Mb",wV="M.*zfinal",},Me={fn="ProjectDIR/rt/between/mf/Core/Me.lua",fullName="Me",loadOrder=7,propT={},stackDepth=0,status="active",userName="Me",wV="M.*zfinal",},a={fn="ProjectDIR/rt/between/mf/Core/a/1.1.lua",fullName="a/1.1",loadOrder=3,propT={},stackDepth=0,status="active",userName="a/1.1",wV="000000001.000000001.*zfinal",},b={fn="ProjectDIR/rt/between/mf/Core/b/1.4.lua",fullName="b/1.4",loadOrder=1,propT={},stackDepth=1,status="active",userName="b/1.4",wV="000000001.000000004.*zfinal",},d={fn="ProjectDIR/rt/between/mf/Core/d/1.3.lua",fullName="d/1.3",loadOrder=5,propT={},stackDepth=1,status="active",userName="d/1.3",wV="000000001.000000003.*zfinal",},e={fn="ProjectDIR/rt/between/mf/Core/e/1.2.lua",fullName="e/1.2",loadOrder=6,propT={},stackDepth=1,status="active",userName="e/1.2",wV="^00000001.000000002.*zfinal",},},mpathA={"ProjectDIR/rt/between/mf/Core",},systemBaseMPATH="ProjectDIR/rt/between/mf/Core",}'; +export _ModuleTable_; diff --git a/src/MName.lua b/src/MName.lua index 24cc6d405..f713cebf2 100644 --- a/src/MName.lua +++ b/src/MName.lua @@ -544,6 +544,7 @@ function M.find_between(self, fileA) return x.pV < y.pV end) + local mrc = MRC:singleton() local fn = false local version = false local lowerBound = self.__range[1] @@ -553,23 +554,18 @@ function M.find_between(self, fileA) local pV = lowerBound local wV = " " -- this is less than the lower possible weight. - - --dbg.print{"lower: ",pV,"\n"} - --dbg.print{"upper: ",upperBound,"\n"} - --dbg.print{"wV: \"",wV,"\"\n\n"} - local idx = nil local found = false for j = 1,#a do local entry = a[j] local v = entry.pV - --dbg.print{"pV: ",pV,", v: ",v,", upper: \"",upperBound,"\"\n"} - --dbg.print{"pV <= v: ",pV <= v, ", v <= upperBound: ",v <= upperBound,", entry.wV > wV: ",entry.wV > wV,"\n"} - if (lowerFn(pV,v) and upperFn(v,upperBound) and entry.wV > wV) then - idx = j - pV = v - wV = entry.wV + if (isMarked(v) or mrc:isVisible{fullName=entry.fullName,sn=entry.sn,fn=entry.fn, + visibleT = {soft = true}}) then + idx = j + pV = v + wV = entry.wV + end end end if (idx) then