Skip to content

Commit

Permalink
Issue TACC#648: force default .modulepath point to the one in @pkg@/init
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed May 18, 2023
1 parent a556a16 commit b9b7d9b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/myGlobals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,23 @@ setenv_posix("LC_ALL","C",true)
-- MODULEPATH in the startup scripts
------------------------------------------------------------------------
local mpath_init = getenv("LMOD_MODULEPATH_INIT")
local default_mpath_init = "@PKG@/init/.modulespath"
local global_mpath_init = "/etc/lmod/.modulespath"
if (not mpath_init) then
local default_mpath_init = "/etc/lmod/.modulespath"
if (access(default_mpath_init, "r")) then
mpath_init = default_mpath_init
if (access(global_mpath_init, "r")) then
mpath_init = global_mpath_init
else
mpath_init = "@modulepath_init@"
if (mpath_init:sub(1,1) == "@") then
mpath_init = default_mpath_init
end
end

end


cosmic:init{name = "LMOD_MODULEPATH_INIT",
sedV = "@modulepath_init@",
default = "@PKG@/init/.modulespath",
default = default_mpath_init,
assignV = mpath_init}

------------------------------------------------------------------------
Expand Down

0 comments on commit b9b7d9b

Please sign in to comment.