Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed Sep 15, 2024
2 parents b61deab + 96c4dec commit f0f909c
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 71 deletions.
5 changes: 5 additions & 0 deletions README.new
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,8 @@ Lmod 8.7+
* Change MF_Base:processVars to use oldT to know which paths from newA to prepend or append
* Add support for LMOD_FILE_IGNORE_PATTERNS in src/DirTree.lua.
This is to ignore files like .version.1.3 or .modulerc-1.3.lua etc
W.I.P:
(8.7.50) * PR #724: Emacs lisp integration updated.
* Issue #718: use command -v instead of checking status $?
* Issue #690: change --hidden_load to --hidden-loaded for TCL
change hidden_load to hidden_loaded in Lua.
2 changes: 1 addition & 1 deletion init/lisp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Return value is t on success, nil otherwise."
(if (> (buffer-size) 0)
(progn
;; replace cmd-buffer w/ contents of file whose name is in cmd-buffer
(insert-file-contents (buffer-substring (point-min) (1- (point-max))) nil nil nil t)
;; (insert-file-contents (buffer-substring (point-min) (1- (point-max))) nil nil nil t)
;; and run it carefully. If an error is thrown, catch it and
;; propagate the fact upwards as a nil, but be sure to still
;; execute cleanup below
Expand Down
6 changes: 3 additions & 3 deletions rt/modulerc/err.txt
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ _ModuleTable_ = {
fullName = "ABC/2.5",
loadOrder = 1,
moduleKindT = {
hidden_load = true,
hidden_loaded = true,
kind = "soft",
},
propT = {},
Expand All @@ -747,7 +747,7 @@ _ModuleTable_ = {
fullName = "C/3.0",
loadOrder = 2,
moduleKindT = {
hidden_load = true,
hidden_loaded = true,
kind = "soft",
},
propT = {},
Expand All @@ -771,7 +771,7 @@ _ModuleTable_ = {
fullName = "E/3.0",
loadOrder = 4,
moduleKindT = {
hidden_load = true,
hidden_loaded = true,
kind = "soft",
},
propT = {},
Expand Down
2 changes: 1 addition & 1 deletion rt/modulerc/mfB/Core/ABC/.modulerc.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
hide{name="ABC/0.5", kind="hard"}
hide{name="ABC/2.5", kind="soft",hidden_load=true}
hide{name="ABC/2.5", kind="soft",hidden_loaded=true}
hide{name="ABC/3.0", kind="soft"}
hide{name="ABC/4.0", kind="hidden"}
hide{name="ABC/5.0", kind="hard"}
2 changes: 1 addition & 1 deletion rt/modulerc/mfB/Core/C/.modulerc.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hide{name="C",kind="soft",hidden_load=true}
hide{name="C",kind="soft",hidden_loaded=true}
2 changes: 1 addition & 1 deletion rt/modulerc/mfB/Core/E/.modulerc.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hide{name="E",kind="soft",hidden_load=true}
hide{name="E",kind="soft",hidden_loaded=true}
2 changes: 1 addition & 1 deletion rt/modulerc/modulerc.tdesc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ EOF
runBase runSpiderCmd -o spiderT $MODULEPATH #60
runBase runSpiderCmd -o dbT $MODULEPATH #61
# Test hidden_load feature
# Test hidden_loaded feature
runLmod load C D E F #62
runLmod --mt #63
runLmod list #64
Expand Down
26 changes: 13 additions & 13 deletions rt/modulerc/out.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions shells/Lisp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ function Lisp.expandVar(self, k, v, vType)
v = tostring(v):multiEscaped()
lineA[#lineA + 1] = "(setenv \""
lineA[#lineA + 1] = k
lineA[#lineA + 1] = "\" "
lineA[#lineA + 1] = "\" \""
lineA[#lineA + 1] = v
lineA[#lineA + 1] = ")\n"
lineA[#lineA + 1] = "\")\n"
local line = concatTbl(lineA,"")
stdout:write(line)
if (k:find('^_ModuleTable') == nil) then
Expand Down
10 changes: 5 additions & 5 deletions spec/ModuleA/ModuleA_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ describe("Testing ModuleA Class #ModuleA.",
fn = "%ProjDir%/spec/ModuleA/mf/bio/bowtie/32/1.0.lua",
fullName = "bio/bowtie/32/1.0",
moduleKindT = {
hidden_load = false,
hidden_loaded = false,
kind = "normal",
},
pV = "bio/bowtie/000000032/000000001.*zfinal",
Expand All @@ -235,7 +235,7 @@ describe("Testing ModuleA Class #ModuleA.",
fn = "%ProjDir%/spec/ModuleA/mf/bio/bowtie/32/2.0.lua",
fullName = "bio/bowtie/32/2.0",
moduleKindT = {
hidden_load = false,
hidden_loaded = false,
kind = "normal",
},
pV = "bio/bowtie/000000032/000000002.*zfinal",
Expand All @@ -245,7 +245,7 @@ describe("Testing ModuleA Class #ModuleA.",
fn = "%ProjDir%/spec/ModuleA/mf/bio/bowtie/64/2.0.lua",
fullName = "bio/bowtie/64/2.0",
moduleKindT = {
hidden_load = false,
hidden_loaded = false,
kind = "normal",
},
pV = "bio/bowtie/000000064/000000002.*zfinal",
Expand All @@ -255,7 +255,7 @@ describe("Testing ModuleA Class #ModuleA.",
fn = "%ProjDir%/spec/ModuleA/mf/bio/genomics.lua",
fullName = "bio/genomics",
moduleKindT = {
hidden_load = false,
hidden_loaded = false,
kind = "normal",
},
pV = "bio/genomics/M.*zfinal",
Expand All @@ -270,7 +270,7 @@ describe("Testing ModuleA Class #ModuleA.",
fn = "%ProjDir%/spec/ModuleA/mf/boost/1.46.0.lua",
fullName = "boost/1.46.0",
moduleKindT = {
hidden_load = false,
hidden_loaded = false,
kind = "normal",
},
pV = "boost/000000001.000000046.*zfinal",
Expand Down
6 changes: 3 additions & 3 deletions src/MName.lua
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@ function M.moduleKindT(self)
if (not self.__moduleKindT) then
return nil
end
local moduleKindT = self.__moduleKindT
local hidden_load = moduleKindT.hidden_load or nil
local moduleKindT = self.__moduleKindT
local hidden_loaded = moduleKindT.hidden_loaded or nil
local t = nil
if (moduleKindT.kind ~= "normal") then
t = {kind = moduleKindT.kind, hidden_load = hidden_load}
t = {kind = moduleKindT.kind, hidden_loaded = hidden_loaded}
end
return t
end
Expand Down
53 changes: 27 additions & 26 deletions src/MRC.lua
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ function M.export(self)
a[1] = serializeTbl{indent = true, name = "mrcT", value = t }
a[2] = serializeTbl{indent = true, name = "mrcMpathT", value = mrcMpathT }
return concatTbl(a,"\n")
--return serializeTbl{indent = true, name = "mrcMpathT", value = mrcMpathT }
end


Expand Down Expand Up @@ -633,9 +634,9 @@ local function l_check_hidden_modifiers(fullName, resultT, visibleT, show_hidden
l_check_user_groups(resultT))

if (not hide_active) then
-- isVisible, hidden_load, kind, count
-- isVisible, hidden_loaded, kind, count
dbg.fini("l_check_hidden_modifiers")
return true, false, "normal", true
return true, false, "normal", true
end
local isVisible
if (show_hidden) then
Expand All @@ -648,32 +649,32 @@ local function l_check_hidden_modifiers(fullName, resultT, visibleT, show_hidden

dbg.print{"fullName: ",fullName,", resultT.kind: ", resultT.kind, ", count: ",count,"\n"}
dbg.fini("l_check_hidden_modifiers")
return isVisible, resultT.hidden_load, resultT.kind, count
return isVisible, resultT.hidden_loaded, resultT.kind, count
end


-- modT is a table with: sn, fullName and fn
function M.isVisible(self, modT)
dbg.start{"MRC:isVisible(modT}"}
local frameStk = require("FrameStk"):singleton()
local mname = frameStk:mname()
local mt = frameStk:mt()
local mpathA = modT.mpathA or mt:modulePathA()
local fullName = modT.fullName
local fn = modT.fn
local sn = modT.sn
local show_hidden = modT.show_hidden
local isVisible = true
local visibleT = modT.visibleT or {}
local kind = "normal"
local hidden_load = false
local count = false
local my_resultT = nil
local frameStk = require("FrameStk"):singleton()
local mname = frameStk:mname()
local mt = frameStk:mt()
local mpathA = modT.mpathA or mt:modulePathA()
local fullName = modT.fullName
local fn = modT.fn
local sn = modT.sn
local show_hidden = modT.show_hidden
local isVisible = true
local visibleT = modT.visibleT or {}
local kind = "normal"
local hidden_loaded = false
local count = false
local my_resultT = nil
------------------------------------------------------------
-- resultT is nil if the modulefile is normal or
-- {kind="hidden|soft|hard"
-- before="<time>" after="<time>",
-- hidden_load = true|nil, }
-- hidden_loaded = true|nil, }
-- if hidden.


Expand All @@ -697,7 +698,7 @@ function M.isVisible(self, modT)
local resultT = l_findHiddenState(self, mpathA, sn, fullName, fn)
if (type(resultT) == "table" ) then
--dbg.printT("from hidden State resultT",resultT)
isVisible, hidden_load, kind, count = l_check_hidden_modifiers(fullName, resultT, visibleT, show_hidden)
isVisible, hidden_loaded, kind, count = l_check_hidden_modifiers(fullName, resultT, visibleT, show_hidden)
elseif (fullName:sub(1,1) == ".") then
isVisible = (visibleT.hidden == true or show_hidden)
count = show_hidden
Expand All @@ -709,18 +710,18 @@ function M.isVisible(self, modT)
count = show_hidden or (idx == nil)
end

modT.isVisible = isVisible
modT.mname = mname
modT.kind = kind
modT.mt = mt
modT.hidden_load = hidden_load
modT.isVisible = isVisible
modT.mname = mname
modT.kind = kind
modT.mt = mt
modT.hidden_loaded = hidden_loaded
hook.apply("isVisibleHook", modT)

my_resultT = { isVisible = modT.isVisible,
moduleKindT = {kind=modT.kind, hidden_load = modT.hidden_load},
moduleKindT = {kind=modT.kind, hidden_loaded = modT.hidden_loaded},
count = count }

--dbg.print{"fullName: ",fullName,", isVisible: ",isVisible,", kind: ",kind,", show_hidden: ", show_hidden,", count: ",count,", hidden_load: ",hidden_load,"\n"}
--dbg.print{"fullName: ",fullName,", isVisible: ",isVisible,", kind: ",kind,", show_hidden: ", show_hidden,", count: ",count,", hidden_loaded: ",hidden_loaded,"\n"}
--dbg.printT("my_resultT",my_resultT)
dbg.fini("MRC:isVisible")
return my_resultT
Expand Down
4 changes: 2 additions & 2 deletions src/RC2lua.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ proc parseMyArgs {args} {
set v [string trimleft $arg -]
dict set argT kind "\"$v\""
}
--hidden_loaded {
dict set argT hidden_load true
--hidden-loaded {
dict set argT hidden_loaded true
}
--not-group - --not-user - --group - --user {
set nextKeyA [string map {- {}} $arg]T
Expand Down
2 changes: 1 addition & 1 deletion src/cmdfuncs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ function List(...)
local fullName = entry.fullName
local origName = entry.origUserName or ""
local showMe = true
if (entry.moduleKindT.hidden_load) then
if (entry.moduleKindT.hidden_loaded) then
showMe = show_hidden
have_hiddenL = not show_hidden
end
Expand Down
20 changes: 10 additions & 10 deletions src/mrc_funcs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ end


local hide_rulesT = {
action = {kind="string", choiceT = {hide = true}},
nameA = {kind="stringArray"},
userA = {kind="stringArray"},
groupA = {kind="stringArray"},
notUserA = {kind="stringArray"},
notGroupA = {kind="stringArray"},
after = {kind="string"},
before = {kind="string"},
kind = {kind="string", choiceT = {hard = true, normal = true, soft = true, hidden = true}},
hidden_load = {kind="boolean"},
action = {kind="string", choiceT = {hide = true}},
nameA = {kind="stringArray"},
userA = {kind="stringArray"},
groupA = {kind="stringArray"},
notUserA = {kind="stringArray"},
notGroupA = {kind="stringArray"},
after = {kind="string"},
before = {kind="string"},
kind = {kind="string", choiceT = {hard = true, soft = true, hidden = true}},
hidden_loaded = {kind="boolean"},
}

function hide(t)
Expand Down
2 changes: 1 addition & 1 deletion src/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ function colorizePropA(style, mt, modT, mrc, propT, legendT, forbiddenT)
moduleName = colorize("hidden",modT.fullName)
pA[#pA+1] = H
legendT[H] = i18n(msg)
if (resultT.moduleKindT.hidden_load) then
if (resultT.moduleKindT.hidden_loaded) then
pA[#pA+1] = "HL"
legendT["HL"] = i18n("HiddenLoadM")
end
Expand Down

0 comments on commit f0f909c

Please sign in to comment.