Skip to content

Commit

Permalink
Issue #613: added save_set_env and reset_env routines
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed Dec 15, 2022
1 parent 149b012 commit 335b2cd
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1005,11 +1005,26 @@ end
------------------------------------------------------------
-- Save changes to env when processing spider cache
function save_set_env(name, value)
local oldV =
if (not getenv(name) and not s_envT[name]) then
fix me!!!
local oldV = getenv(name)
if (not oldV and not s_envT[name]) then
s_clrEnvT[name] = true
else
s_envT[name] = oldV
end
setenv_posix(name. value, true)
end

function reset_env()
for k, v in pairs(s_envT) do
setenv_posix(k, v, true)
end
for k, v in pairs(s_clrEnvT) do
setenv_posix(k, v, true)
end
s_clrEnvT = {}
s_envT = {}
end


------------------------------------------------------------
-- Initialize Lmod
Expand Down

0 comments on commit 335b2cd

Please sign in to comment.