e2lib.logf(4, "loading plugins from: %s", dir)
local pfn = {}
- for fn in e2lib.directory(dir) do
+ for fn, re in e2lib.directory(dir) do
+ if not fn then
+ return false, e:cat(re)
+ end
+
table.insert(pfn, fn)
end
return false, err.new("config in %s would be shadowed", cfdir)
end
- for f in e2lib.directory(cfdir, false, true) do
+ local re
+ for f, re in e2lib.directory(cfdir, false, true) do
+ if not f then
+ return false, re
+ end
+
if e2lib.isdir(e2lib.join(cfdir, f)) then
return shadow_config_down(src_res, e2lib.join(pathname, f))
end
if not rc then
return false, e:cat(re)
end
- for f in e2lib.directory(".") do
+ for f, re in e2lib.directory(".") do
+ if not f then
+ return false, e:cat(re)
+ end
+
rc, re = e2lib.mv(f, destdir)
if not rc then
return false, e:cat(re)
bd=bd..string.format("source %s/env/builtin\n", res.build_config.Tc)
bd=bd..string.format("source %s/env/env\n", res.build_config.Tc)
local brc_noinit = bd
- for x in e2lib.directory(info.root .. "/proj/init") do
+ for x, re in e2lib.directory(info.root .. "/proj/init") do
+ if not x then
+ return false, e:cat(re)
+ end
+
if not e2lib.is_backup_file(x) then
bd=bd..string.format("source %s/init/%s\n", res.build_config.Tc, x)
end
local res = info.results[r]
local rc, re
local e = err.new("installing init files")
- for x in e2lib.directory(info.root .. "/proj/init") do
+ for x, re in e2lib.directory(info.root .. "/proj/init") do
+ if not x then
+ return false, e:cat(re)
+ end
+
if not e2lib.is_backup_file(x) then
local location = string.format("proj/init/%s", x)
local abslocation = string.format("%s/%s", info.root, location)
return true
end
local files = {}
- for f in e2lib.directory("result/files") do
+ local re
+ for f, re in e2lib.directory("result/files") do
+ if not f then
+ return false, re
+ end
+
table.insert(files, string.format("files/%s", f))
end
table.insert(files, "checksums")
--- gather source paths.
local function gather_source_paths(info, basedir, sources)
sources = sources or {}
- for dir in e2lib.directory(info.root .. "/" .. e2tool.sourcedir(basedir)) do
+ for dir, re in e2lib.directory(e2lib.join(info.root, e2tool.sourcedir(basedir))) do
+ if not dir then
+ return false, re
+ end
+
local tmp
if basedir then
tmp = basedir .. "/" .. dir
local e = err.new("error loading source configuration")
info.sources = {}
- for _,src in ipairs(gather_source_paths(info)) do
+ local sources, re = gather_source_paths(info)
+ if not sources then
+ return false, e:cat(re)
+ end
+
+ for _,src in ipairs(sources) do
local list, re
local path = e2tool.sourceconfig(src)
local types = { "e2source", }
--- gather result paths.
local function gather_result_paths(info, basedir, results)
results = results or {}
- for dir in e2lib.directory(info.root .. "/" .. e2tool.resultdir(basedir)) do
+ for dir, re in e2lib.directory(e2lib.join(info.root, e2tool.resultdir(basedir))) do
+ if not dir then
+ return false, re
+ end
+
local tmp
if basedir then
tmp = basedir .. "/" .. dir
local e = err.new("error loading result configuration")
info.results = {}
- for _,res in ipairs(gather_result_paths(info)) do
+ local results, re = gather_result_paths(info)
+ if not results then
+ return false, e:cat(re)
+ end
+
+ for _,res in ipairs(results) do
local list, re
local path = e2tool.resultconfig(res)
local types = { "e2result", }
end
-- catch proj/init/*
local hc = hash.hash_start()
- for f in e2lib.directory(info.root .. "/proj/init") do
+ for f, re in e2lib.directory(e2lib.join(info.root, "proj/init")) do
+ if not f then
+ return false, re
+ end
+
if not e2lib.is_backup_file(f) then
local location = string.format("proj/init/%s",
e2lib.basename(f))