* type: string
* server: string
* licences: (old: licence) table of strings
+* env: dictionary, merged into result specific env for results that use
+ this source
files source (type = files, default)
local hc = hash.hash_start()
hash.hash_line(hc, src.name)
hash.hash_line(hc, src.type)
+ hash.hash_line(hc, src._env:id())
for _,l in ipairs(src.licences) do
hash.hash_line(hc, l)
local licenceid, re = e2tool.licenceid(info, l)
local res = info.results[resultname]
local env = environment.new()
env:merge(info.global_env, false)
+ for _, s in ipairs(res.sources) do
+ env:merge(info.sources[s]._env, true)
+ end
env:merge(res._env, true)
return env
end
local hc = hash.hash_start()
hash.hash_line(hc, src.name)
hash.hash_line(hc, src.type)
+ hash.hash_line(hc, src._env:id())
for _,l in ipairs(src.licences) do
hash.hash_line(hc, l)
local licenceid, re = e2tool.licenceid(info, l)
if not src.type then
e:append("source has no `type' attribute")
end
+ if src.env and type(src.env) ~= "table" then
+ e:append("source has invalid `env' attribute")
+ else
+ if not src.env then
+ e2lib.warnf("WDEFAULT",
+ "source has no `env' attribute. Defaulting to empty dictionary")
+ src.env = {}
+ end
+ src._env = environment.new()
+ for k,v in pairs(src.env) do
+ if type(k) ~= "string" then
+ e:append("in `env' dictionary: key is not a string: %s", tostring(k))
+ elseif type(v) ~= "string" then
+ e:append("in `env' dictionary: value is not a string: %s", tostring(v))
+ else
+ src._env:set(k, v)
+ end
+ end
+ end
if e:getcount() > 1 then
return false, e
end
local hc = hash.hash_start()
hash.hash_line(hc, src.name)
hash.hash_line(hc, src.type)
+ hash.hash_line(hc, src._env:id())
for _,l in ipairs(src.licences) do
hash.hash_line(hc, l)
local licenceid, re = e2tool.licenceid(info, l)
local hc = hash.hash_start()
hash.hash_line(hc, src.name)
hash.hash_line(hc, src.type)
+ hash.hash_line(hc, src._env:id())
for _,l in pairs(src.licences) do
hash.hash_line(hc, l)
end
name = "name",
-- the source type
type = "cvs",
+ -- environment
+ env = {
+ key = "value",
+ },
-- a list of licences from proj/licences
licences={ },
-- cvs specific attributes
name = "name",
-- the source type
type = "files",
+ -- environment
+ env = {
+ key = "value",
+ },
-- a list of licences from proj/licences
licences = { },
-- the server. Files can specify their own one or inherit this one.
name = "name",
-- the source type
type = "git",
+ -- environment
+ env = {
+ key = "value",
+ },
-- a list of licences from proj/licences
licences = { },
-- git specific attributes
name = "name",
-- the source type
type = "svn",
+ -- environment
+ env = {
+ key = "value",
+ },
-- a list of licences from proj/licences
licences={ },
-- svn specific attributes