Skip to content

Commit

Permalink
Added mrc:set_display_mode() before commands; updated broken_moduler…
Browse files Browse the repository at this point in the history
…c gold files
  • Loading branch information
Robert McLay committed Oct 29, 2024
1 parent 2e2744a commit 22b9839
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.new
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,4 @@ Lmod 8.7+
W.I.P.:
(8.7.54) * Remove all v.file tests in dealing with ModuleA
* using self.__mpathT[mpath].hiddenT and self.__hiddenT instead of merged table for hidden status
* Added mrc:set_display_mode() before commands.
3 changes: 2 additions & 1 deletion rt/broken_modulerc/err.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
step 1
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --version
===========================
Modules based on Lua: Version 8.7.32 2023-08-28 12:42 -05:00
Modules based on Lua: Version 8.7.53 2024-10-12 19:57 -05:00
by Robert McLay mclay@tacc.utexas.edu
===========================
step 2
lua ProjectDIR/src/lmod.in.lua shell --regression_testing use ProjectDIR/rt/broken_modulerc/mf/Core
===========================
Lmod Warning: Badly formed module-version line: module-name must be fully qualified: hdf5 is not.
===========================
step 3
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load git hdf5/1.8.15
Expand Down
9 changes: 8 additions & 1 deletion src/Hub.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,11 @@ function M.access(self, ...)
local shellNm = shell:name()
local help = (_G.help ~= dbg.quiet) and "-h" or nil
local A = ShowResultsA
local mrc = MRC:singleton()
local result, t

mrc:set_display_mode("all")

local argA = pack(...)
if (optionTbl.location or optionTbl.terse) then
local userName = argA[1]
Expand Down Expand Up @@ -969,6 +972,9 @@ function M.overview(self,argA)
local mt = FrameStk:singleton():mt()
local mpathA = mt:modulePathA()
local availStyle = optionTbl.availStyle
local mrc = MRC:singleton()

mrc:set_display_mode("avail")

local numDirs = 0
for i = 1,#mpathA do
Expand All @@ -987,7 +993,8 @@ function M.overview(self,argA)
return a
end

local mrc = MRC:singleton()


local use_cache = false
local moduleA = ModuleA:singleton{spider_cache=use_cache}
local availA = moduleA:build_availA()
Expand Down
2 changes: 2 additions & 0 deletions src/MRC.lua
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,11 @@ function M.parseModA(self, modA, weight)
local entry = modA[i]
if (entry.action == "module_version") then
local fullName = entry.module_name
dbg.printT("entry",entry)
fullName = self:resolve({}, fullName)

local _, _, shorter, mversion = fullName:find("(.*)/(.*)")
dbg.print{"fullName: ",fullName,", shorter: ", shorter,"\n"}
if (shorter == nil) then
LmodWarning{msg="w_Broken_FullName", fullName= fullName}
break
Expand Down
6 changes: 4 additions & 2 deletions src/check_module_tree_syntax.in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,16 @@ function main()
local pargs = optionTbl.pargs
local mpathA = {}
local errorT = { defaultA = {}, syntaxA = {} }
local mrc = MRC:singleton()

mrc:set_display_mode("spider")
Shell = BaseShell:build("bash")

------------------------------------------------------------------
-- initialize lmod with SitePackage and /etc/lmod/lmod_config.lua
initialize_lmod()

local mrc = MRC:singleton()
mrc:set_display_mode("spider")

dbg.set_prefix(colorize("red","Lmod"))

local hub = Hub:singleton(false)
Expand Down
13 changes: 13 additions & 0 deletions src/cmdfuncs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ end
function Category(...)
dbg.start{"Category(", concatTbl({...},", "),")"}
local shell = _G.Shell
local mrc = MRC:singleton()

mrc:set_display_mode("spider")

local cache = Cache:singleton{buildCache = true}
local moduleT, dbT = cache:build()
Expand Down Expand Up @@ -304,6 +306,9 @@ function Help(...)
end

function IsAvail(...)
local mrc = MRC:singleton()
mrc:set_display_mode("avail")

local argA = pack(...)
for i = 1, argA.n do
local mname = MName:new("load", argA[i])
Expand All @@ -315,6 +320,9 @@ function IsAvail(...)
end

function IsLoaded(...)
local mrc = MRC:singleton()
mrc:set_display_mode("avail")

local argA = pack(...)
for i = 1, argA.n do
local mname = MName:new("mt", argA[i])
Expand All @@ -331,6 +339,7 @@ end
function Keyword(...)
dbg.start{"Keyword(",concatTbl({...},","),")"}

local mrc = MRC:singleton(); mrc:set_display_mode("spider")
local banner = Banner:singleton()
local border = banner:border(0)
local shell = _G.Shell
Expand Down Expand Up @@ -878,6 +887,9 @@ function Restore(collection)
if (collection == "system" ) then
Reset(msg)
else
local mrc = MRC:singleton()
mrc:set_display_mode("all")

local mt = FrameStk:singleton():mt()
local results = mt:getMTfromFile{fn=path, name=myName, msg=msg}
if (not results and collection == "default") then
Expand Down Expand Up @@ -1272,6 +1284,7 @@ function UnUse(...)
MCP:remove_path{ModulePath, v, delim=":", nodups = true, force = true}
end
if (mt:changeMPATH()) then
local mrc = MRC:singleton(); mrc:set_display_mode("all")
mt:reset_MPATH_change_flag()
hub.reloadAll()
end
Expand Down

0 comments on commit 22b9839

Please sign in to comment.