return true, nil
end
+--- Open debug logfile.
local function opendebuglogfile(info)
local rc, re = e2lib.mkdir(info.root .. "/log", "-p")
if not rc then
return true, nil
end
+--- check results.
local function check_results(info)
local e = err.new("Error while checking results")
local rc, re
return info
end
+--- hashcache setup.
local function hashcache_setup(info)
local e = err.new("reading hash cache")
local rc, re
return false, e:append("configuration syntax mismatch")
end
+--- load env config.
local function load_env_config(info, file)
e2lib.logf(4, "loading environment: %s", file)
local e = err.new("loading environment: %s", file)
return true
end
+--- 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
return sources
end
--- checks for valid characters in str
+--- checks for valid characters in str
local function checkFilenameInvalidCharacters(str)
local msg = "only digits, alphabetic characters, and '-_./' " ..
"are allowed"
end
end
--- check for invalid characters in source/result names
+--- check for invalid characters in source/result names
local function checkNameInvalidCharacters(str)
local msg = "only digits, alphabetic characters, and '-_.' " ..
"are allowed"
end
end
--- replaces all slashed in str with dots
+--- replaces all slashed in str with dots
local function slashToDot(str)
return string.gsub(str,"/",".",100)
end
+--- load source config.
local function load_source_config(info)
local e = err.new("error loading source configuration")
info.sources = {}
return true, nil
end
--- assemble a path from parts
+--- assemble a path from parts.
-- the returned string is created from the input parameters like
-- "base[/str][/postfix]"
local function generatePath(base, str, postfix)
return base
end
--- get directory for a result
+--- get directory for a result.
-- Returns the path to the resultdir and the optional postfix is appended
-- with a slash (e.g. res/name/build-script)
-- @param result name optional
return generatePath("res",name,postfix)
end
--- get directory for a source
+--- get directory for a source.
-- Returns the path to the sourcedir and the optional postfix is appended
-- with a slash (e.g. src/name/config)
-- @param source name optional
return generatePath("src",name,postfix)
end
--- get path to the result config
+--- get path to the result config.
-- @param resultname
-- @return path to the resultconfig
function e2tool.resultconfig(name)
return e2tool.resultdir(name,"config")
end
--- get path to the result build-script
+--- get path to the result build-script
-- @param resultname
-- @return path to the result build-script
function e2tool.resultbuildscript(name)
return e2tool.sourcedir(name,"config")
end
+--- 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
end
return results
end
-
+
+--- load result config.
local function load_result_config(info)
local e = err.new("error loading result configuration")
info.results = {}
return true, nil
end
+--- collect project info.
function e2tool.collect_project_info(info, skip_load_config)
local rc, re
local e = err.new("reading project configuration")
return true
end
+--- check source.
local function check_source(info, sourcename)
local src = info.sources[sourcename]
local rc, e, re
return true, nil
end
+--- check sources.
local function check_sources(info)
local e = err.new("Error while checking sources")
local rc, re
return true, nil
end
+--- check licences.
local function check_licences(info)
local e = err.new("Error while checking licences")
local rc, re
return true, nil
end
---
--- e2tool.check_project_info(INFO, ALL, [ACCESS, [VERBOSE]]) -> BOOLEAN
+--- e2tool.check_project_info(INFO, ALL, [ACCESS, [VERBOSE]]) -> BOOLEAN.
--
-- Checks project information for consistancy
-- When ALL is false, check only those results/sources reachable from
-- the dependency list
-- When ACCESS is true, checks also server locations
-- When VERBOSE is true, sends error messages to stderr
-
function e2tool.check_project_info(info, all, access, verbose)
local rc, re
local e = err.new("error in project configuration")
return true, nil
end
--- Dependency management
---
--- e2tool.dsort(INFO) -> ARRAY
---
--- Returns an array with the names of all results of the project specified
--- by INFO, topologically sorted according to the projects dependency
--- information.
---
--- e2tool.dlist(INFO, RESULT) -> ARRAY
---
--- Returns a sorted array with all dependencies for the given RESULT in the
--- project specified by INFO, the RESULT itself excluded.
---
--- e2tool.dlist_recursive(INFO, RESULT) -> ARRAY
---
--- Similar to e2tool.dlist(), but also includes indirect dependencies.
--- If RESULT is a table, calculate dependencies for all elements, inclusive,
--- otherwise calculate dependencies for RESULT, exclusive.
-
--- get dependencies for use in build order calculation
function e2tool.get_depends(info, resultname)
local t = {}
return t
end
+--- e2tool.dlist(INFO, RESULT) -> ARRAY.
+--
+-- Returns a sorted array with all dependencies for the given RESULT in the
+-- project specified by INFO, the RESULT itself excluded.
function e2tool.dlist(info, resultname)
local t = {}
for _,f in ipairs(info.ftab.dlist) do
return t
end
+--- e2tool.dlist_recursive(INFO, RESULT) -> ARRAY.
+--
+-- Similar to e2tool.dlist(), but also includes indirect dependencies.
+-- If RESULT is a table, calculate dependencies for all elements, inclusive,
+-- otherwise calculate dependencies for RESULT, exclusive.
function e2tool.dlist_recursive(info, result)
local had = {}
local path = {}
return t, nil
end
+--- e2tool.dsort(INFO) -> ARRAY.
+--
+-- Returns an array with the names of all results of the project specified
+-- by INFO, topologically sorted according to the projects dependency
+-- information.
function e2tool.dsort(info)
return e2tool.dlist_recursive(info, info.default_results)
end
+--- read hash file.
local function read_hash_file(info, server, location)
local e = err.new("error reading hash file")
local cs = nil
return ctx:hash_finish()
end
---- hash a file addressed by server name and location
+--- hash a file addressed by server name and location.
-- @param info info structure
-- @param server the server name
-- @param location file location relative to the server
end
--- verify that a file addressed by server name and location matches the
--- checksum given in the sha1 parameter
+-- checksum given in the sha1 parameter.
-- @param info info structure
-- @param server the server name
-- @param location file location relative to the server
return true, nil
end
+--- project id.
local function projid(info)
if info.projid then
return info.projid
return info.projid
end
--- Check if e2 is in a fixed tag
+--- Check if e2 is in a fixed tag.
--
-- e2tool.e2_has_fixed_tag(info)
--
-- return true if e2 is at fixed tag, and false if not.
-
function e2tool.e2_has_fixed_tag(info)
local v = e2lib.parse_e2versionfile(info.root .. "/.e2/e2version")
e2lib.log(2, "Checking for fixed e2 tag.")
return true
end
+--- hashcache write.
local function hashcache_write(info)
local e = err.new("writing hash cache file")
local f, msg = io.open(info.hashcache_file, "w")
return true
end
+--- hashcache.
local function hashcache(info, file)
local e = err.new("getting fileid from hash cache failed")
local rc, re, fileid
return r.build_mode.buildid(r.buildid)
end
+--- chroot group id.
local function chrootgroupid(info, groupname)
local e = err.new("calculating chroot group id failed for group %s",
groupname)
end
end
+--- flush buildids.
function e2tool.flush_buildids(info)
for r, res in pairs(info.results) do
res.buildid = nil
end
end
+--- calculate chrootids.
local function calc_chrootids(info)
for _,grp in pairs(info.chroot.groups) do
chrootgroupid(info, grp.name)
end
end
---return a table of environment variables valid for a result
+--- return a table of environment variables valid for a result
-- @param info the info table
-- @param resultname string: name of a result
-- @return table: environment variables valid for the result
return env
end
+--- add source result.
local function add_source_result(info, sourcename, source_set)
e2lib.log(3, string.format("adding source result for source %s",
sourcename))
info.results[r.name] = r
end
+--- add source results.
local function add_source_results(info, source_set)
e2lib.log(4, "add source results")
for _, src in pairs(info.sources) do
end
end
+--- check licence.
local function check_licence(info, l)
local e = err.new("in licence: %s", l)
local lic = info.licences[l]
return true
end
+--- check working copies.
local function check_workingcopies(info)
local e = err.new("Error while checking working copies")
local rc, re
return true
end
+--- register collect project info.
function e2tool.register_collect_project_info(info, func)
if type(info) ~= "table" or type(func) ~= "function" then
return false, err.new("register_collect_project_info: invalid argument")
return true, nil
end
+--- register check result.
function e2tool.register_check_result(info, func)
if type(info) ~= "table" or type(func) ~= "function" then
return false, err.new("register_check_result: invalid argument")
return true, nil
end
+--- register resultid.
function e2tool.register_resultid(info, func)
if type(info) ~= "table" or type(func) ~= "function" then
return false, err.new("register_resultid: invalid argument")
return true, nil
end
+--- register project buildid.
function e2tool.register_pbuildid(info, func)
if type(info) ~= "table" or type(func) ~= "function" then
return false, err.new("register_pbuildid: invalid argument")
return true, nil
end
+--- register dlist.
function e2tool.register_dlist(info, func)
if type(info) ~= "table" or type(func) ~= "function" then
return false, err.new("register_dlist: invalid argument")