return e2tool.dlist_recursive(info, info.default_results)
end
--- Retrieval of files information
---
--- e2tool.expanded_files_list(INFO, SOURCE)
---
--- For the given source of type file, calculate the absolute pathname of
--- the file, expand directories to the files it contains. The resulting
--- list is cached to INFO.sources.*.flist and returned, with the
--- absolute filename as key and the value telling whether it is local.
-
function e2tool.read_hash_file(info, server, location)
local e = new_error("error reading hash file")
local cs = nil
return true, nil
end
-function e2tool.expanded_files_list(info, source)
- e2lib.log(4, "expanded_files_list: " .. source)
-
- local function add_to_files_list(info, flist, file)
- e2lib.log(4, "add_to_files_list: " .. file.name)
- local rserv, islocal = e2tool.lookup_server(info, file.server)
- if not rserv then e2lib.abort("cannot resolve server: " .. file.server) end
- local absol = rserv .. "/" .. file.name
- local dir, base, ftyp = e2lib.splitpath(absol)
- if not dir then
- e2lib.abort(base .. ": " .. file.name)
- end
- if ftyp ~= "regular" then
- e2lib.abort("is not a regular file: " .. file.name)
- end
- local t = {}
- for k, v in pairs(file) do t[k] = v end
- t.absol = absol
- t.islocal = islocal
- t.base = base
- table.insert(flist, t)
- end
- local s = info.sources[source]
- if s.flist then return s.flist end
- if not s.file then return nil end
- s.flist = {}
- for _, t in ipairs(s.file) do
- add_to_files_list(info, s.flist, t)
- end
- for _,f in pairs(s.flist) do
- e2lib.log(4, "expanded_files_list: s.flist[x].absol: " .. f.absol)
- end
- return s.flist
-end
-
function e2tool.projid(info)
if info.projid then
return info.projid
+++ /dev/null
---[[
- e2factory, the emlix embedded build system
-
- Copyright (C) 2007-2009 Gordon Hecker <gh@emlix.com>, emlix GmbH
- Copyright (C) 2007-2009 Oskar Schirmer <os@emlix.com>, emlix GmbH
- Copyright (C) 2007-2008 Felix Winkelmann, emlix GmbH
-
- For more information have a look at http://www.e2factory.org
-
- e2factory is a registered trademark by emlix GmbH.
-
- This file is part of e2factory, the emlix embedded build system.
-
- e2factory is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-]]
-
--- lookup-server -*- Lua -*-
-
-require("e2local")
-e2lib.init()
-
-e2option.documentation = [[
-usage: e2-lookup-server <server>
-
-lookup the given server and print its absolute path
-]]
-
-local opts = e2option.parse(arg)
-if #opts.arguments ~= 1 then e2option.usage(1) end
-local info, re = e2tool.collect_project_info()
-if not info then
- e2lib.abort(re)
-end
-
-e2lib.log_invocation(info, arg)
-
-local server, islocal = e2tool.lookup_server(info, opts.arguments[1])
-if not server then e2options.usage(1) end
-print(server)
-
-e2lib.finish()