local e = new_error("installing build time dependencies")
e2lib.log(3, string.format("install_build_time_dependencies"))
local deps
- deps = e2tool.dlist(info, r)
+ deps = e2tool.get_depends(info, r)
for i, dep in pairs(deps) do
local tmpdir = e2lib.mktempdir()
local e = new_error("installing build time dependency failed: %s", dep)
check_result = {}, -- f(info, resultname)
resultid = {}, -- f(info, resultname)
pbuildid = {}, -- f(info, resultname)
+ dlist = {}, -- f(info, resultname)
}
rc, re = register_check_result(info, check_result)
if not rc then
return nil, e:cat(re)
end
+ rc, re = register_dlist(info, get_depends)
+ if not rc then
+ return nil, e:cat(re)
+ end
-- load local plugins
local ctx = { -- plugin context
-- If RESULT is a table, calculate dependencies for all elements, inclusive,
-- otherwise calculate dependencies for RESULT, exclusive.
-function dlist(info, res)
- local t = info.results[res] and info.results[res].depends or {}
- table.sort(t)
+--- get dependencies for use in build order calculation
+function get_depends(info, resultname)
+ local t = {}
+ local res = info.results[resultname]
+ if not res.depends then
+ return t
+ end
+ table.sort(res.depends)
+ for _,d in ipairs(res.depends) do
+ table.insert(t, d)
+ end
+ return t
+end
+
+function dlist(info, resultname)
+ local t = {}
+ for _,f in ipairs(info.ftab.dlist) do
+ local deps = f(info, resultname)
+ for _,d in ipairs(deps) do
+ table.insert(t, d)
+ end
+ end
return t
end
return true, nil
end
+function register_dlist(info, func)
+ if type(info) ~= "table" or type(func) ~= "function" then
+ return false, new_error("register_dlist: invalid argument")
+ end
+ table.insert(info.ftab.dlist, func)
+ return true, nil
+end
+
function load_env_config(info, file)
e2lib.logf(4, "loading environment: %s", file)
local e = new_error("loading environment: %s", file)