Commit 94c7dfa6 authored by Natanael Copa's avatar Natanael Copa
Browse files

aports.lua: try get vars from env var before parsing abuild.conf

parent bbd9f10d
......@@ -5,11 +5,21 @@ abuild_conf_file = "/etc/abuild.conf"
local abuild_conf = {}
function get_abuild_conf(var)
if abuild_conf[var] == nil then
-- check cache
if abuild_conf[var] ~= nil then
return abuild_conf[var]
end
-- use os env var
abuild_conf[var] = os.getenv(var)
if abuild_conf[var] ~= nil then
return abuild_conf[var]
end
-- parse config file
local f = io.popen(" . "..abuild_conf_file..' ; echo -n "$'..var..'"')
abuild_conf[var] = f:read("*all")
f:close()
end
return abuild_conf[var]
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment