e2lib.init()
local info, re = e2tool.local_init(nil, "build-numbers")
if not info then
- e2lib.abort(re)
+ return false, re
end
return false, err.new("e2-build-numbers is deprecated and has been removed")
e2lib.init()
local info, re = e2tool.local_init(nil, "build")
if not info then
- e2lib.abort(re)
+ return false, re
end
e2option.flag("all", "build all results (default unless for working copy)")
rc, re = info.cache:set_writeback(set.server, false)
if not rc then
local e = err.new(disable_msg, set.server)
- e2lib.abort(e:cat(re))
+ return false, e:cat(re)
end
elseif set.set == "enable" then
e2lib.logf(3, enable_msg, set.server)
rc, re = info.cache:set_writeback(set.server, true)
if not rc then
local e = err.new(enable_msg, set.server)
- e2lib.abort(e:cat(re))
+ return false, e:cat(re)
end
end
end
-- get build mode from the command line
local build_mode = policy.handle_commandline_options(opts, true)
if not build_mode then
- e2lib.abort("no build mode given")
+ return false, err.new("no build mode given")
end
info, re = e2tool.collect_project_info(info)
if not info then
- e2lib.abort(re)
+ return false, re
end
perform_writeback_settings(writeback)
local rc, re = e2tool.check_project_info(info)
if not rc then
- e2lib.abort(re)
+ return false, re
end
-- apply the standard build mode to all results
local build_mode = nil
if opts["branch-mode"] and opts["wc-mode"] then
e = err.new("--branch-mode and --wc-mode are mutually exclusive")
- e2lib.abort(e)
+ return false, e
end
if opts["branch-mode"] then
-- selected results get a special build mode
local playground = opts["playground"]
if playground then
if opts.release then
- e2lib.abort("--release and --playground are mutually exclusive")
+ return false,
+ err.new("--release and --playground are mutually exclusive")
end
if opts.all then
- e2lib.abort("--all and --playground are mutually exclusive")
+ return false,
+ err.new("--all and --playground are mutually exclusive")
end
if #arguments ~= 1 then
- e2lib.abort("please select one single result for the playground")
+ return false,
+ err.new("please select one single result for the playground")
end
end
local force_rebuild = opts["force-rebuild"]
local keep_chroot = opts["keep"]
-- apply flags to the selected results
- rc, re = e2tool.select_results(info, results, force_rebuild, request_buildno,
- keep_chroot, build_mode, playground)
+ rc, re = e2tool.select_results(info, results, force_rebuild,
+ request_buildno, keep_chroot, build_mode, playground)
if not rc then
- e2lib.abort(re)
+ return false, re
end
-- a list of results to build, topologically sorted
local re
sel_res, re = e2tool.dlist_recursive(info, results)
if not sel_res then
- e2lib.abort(re)
+ return false, re
end
else
local re
sel_res, re = e2tool.dsort(info)
if not sel_res then
- e2lib.abort(re)
+ return false, re
end
end
rc, re = e2tool.print_selection(info, sel_res)
if not rc then
- e2lib.abort(re)
+ return false, re
end
if opts.release and not e2tool.e2_has_fixed_tag(info) then
- e2lib.abort("Failure: e2 is on pseudo tag while building in release mode.")
+ return false, err.new("Failure: e2 is on pseudo tag while building in release mode.")
end
-- calculate buildids for selected results
for _,r in ipairs(sel_res) do
local bid, re = e2tool.buildid(info, r)
if not bid then
- e2lib.abort(re)
+ return false, re
end
end
for _,r in ipairs(sel_res) do
print(string.format("%-20s [%s]", r, e2tool.buildid(info, r)))
end
- e2lib.finish()
+
+ return true
end
-- build
local rc, re = e2build.build_results(info, sel_res)
if not rc then
- e2lib.abort(re)
+ return false, re
end
return true
e2lib.init()
local info, re = e2tool.local_init(nil, "cf")
if not info then
- e2lib.abort(re)
+ return false, re
end
local opts, arguments = e2option.parse(arg)
-- the project configuration.
info, re = e2tool.collect_project_info(info, true)
if not info then
- e2lib.abort(re)
+ return false, re
end
local rc, re = e2lib.chdir(info.root)
if not rc then
- e2lib.abort(re)
+ return false, re
end
commands.editbuildscript = editbuildscript
end
if #match == 0 then
- e2lib.abort(err.new("unknown command"))
+ return false, err.new("unknown command")
elseif #match == 1 then
local a = {}
for _,o in ipairs(arguments) do
local f = commands[match[1]]
rc, re = f(info, a)
if not rc then
- e2lib.abort(re)
+ return false, re
end
else
- e2lib.abort(err.new("Ambiguous command: \"%s\" matches: %s",
- cmd, table.concat(match, ', ')))
+ return false, err.new("Ambiguous command: \"%s\" matches: %s",
+ cmd, table.concat(match, ', '))
end
return true
e2lib.init()
local info, re = e2tool.local_init(nil, "dlist")
if not info then
- e2lib.abort(re)
+ return false, re
end
e2option.flag("recursive", "show indirect dependencies, too")
local opts, arguments = e2option.parse(arg)
if #arguments == 0 then
- e2lib.abort("no result given - enter `e2-dlist --help' for usage information")
+ return false,
+ err.new("no result given - enter `e2-dlist --help' for usage information")
elseif #arguments ~= 1 then e2option.usage(1) end
local result = arguments[1]
info, re = e2tool.collect_project_info(info)
if not info then
- e2lib.abort(re)
+ return false, re
end
if not info.results[ result ] then
- e2lib.abort("no such result: ", result)
+ return false, err.new("no such result: ", result)
end
local dep, re
dep, re = e2tool.dlist(info, result)
end
if not dep then
- e2lib.abort(re)
+ return false, re
end
for i = 1, #dep do
e2lib.init()
local info, re = e2tool.local_init(nil, "dsort")
if not info then
- e2lib.abort(re)
+ return false, re
end
e2option.parse(arg)
info, re = e2tool.collect_project_info(info)
if not info then
- e2lib.abort(re)
+ return false, re
end
local d = e2tool.dsort(info)
e2lib.init()
local info, re = e2tool.local_init(nil, "fetch-sources")
if not info then
- e2lib.abort(re)
+ return false, re
end
local e = err.new()
local opts, arguments = e2option.parse(arg)
info, re = e2tool.collect_project_info(info)
if not info then
- e2lib.abort(re)
+ return false, info
end
local rc, re = e2tool.check_project_info(info)
if not rc then
- e2lib.abort(e:cat(re))
+ return false, e:cat(re)
end
if not (opts.fetch or opts.update) then
for _,file in ipairs(info.chroot.groups_byname[c].files) do
local rc, e = info.cache:cache_file(file.server, file.location, {})
if not rc then
- return false, "caching file failed"
+ return false, err.new("caching file failed")
end
end
end
sel[s] = s
end
elseif opts.result then
- e2lib.abort("is not a result: " .. x)
+ return false, err.new("is not a result: %s", x)
else
- e2lib.abort("is not a source: " .. x)
+ return false, err.new("is not a source: %s", x)
end
end
elseif opts["all"] then
end
end
if e:getcount() > 0 then
- e2lib.abort(e)
+ return false, e
end
if opts.chroot then
end
if e:getcount() > 0 then
- e2lib.abort(e)
+ return false, e
end
return true
e2lib.init()
local info, re = e2tool.local_init(nil, "ls-project")
if not info then
- e2lib.abort(re)
+ return false, re
end
policy.register_commandline_options()
info, re = e2tool.collect_project_info(info)
if not info then
- e2lib.abort(re)
+ return false, re
end
local rc, re = e2tool.check_project_info(info)
if not rc then
- e2lib.abort(re)
+ return false, re
end
local results = {}
if info.results[r] then
table.insert(results, r)
else
- e2lib.abort(err.new("not a result: %s", r))
+ return false, err.new("not a result: %s", r)
end
end
end
if #results > 0 then
results, re = e2tool.dlist_recursive(info, results)
if not results then
- e2lib.abort(re)
+ return false, re
end
else
results, re = e2tool.dsort(info)
if not results then
- e2lib.abort(re)
+ return false, re
end
end
table.sort(results)
p2(s1, s2, src.name)
local t, re = scm.display(info, src.name)
if not t then
- e2lib.abort(re)
+ return false, re
end
for _,line in pairs(t) do
p3(s1, s2, line)
e2lib.init()
local info, re = e2tool.local_init(nil, "new-source")
if not info then
- e2lib.abort(re)
+ return false, re
end
e2option.flag("git", "create a git repository")
info, re = e2tool.collect_project_info(info)
if not info then
- e2lib.abort(re)
+ return false, re
end
if opts.git then
if #arguments ~= 1 then
- e2lib.abort("<name> argument required")
+ return false, err.new("<name> argument required")
end
-- remote
local rserver = info.default_repo_server
local rc, re = generic_git.new_repository(info.cache, lserver, llocation,
rserver, rlocation, flags)
if not rc then
- e2lib.abort(re)
+ return false, re
end
e2lib.log(1, "Read e2-new-source(1) for the next step")
elseif opts.files then
local location = arguments[1]
local sl, e = e2lib.parse_server_location(location, info.default_files_server)
if not sl then
- e2lib.abort(e)
+ return false, e
end
local server = sl.server
local location = sl.location
local checksum_file = arguments[3]
local verify = not opts["no-checksum"]
if verify and not checksum_file then
- e2lib.abort("checksum file argument missing")
+ return false, err.new("checksum file argument missing")
end
local rc, re = new_files_source(info.cache, server, location, source_file,
checksum_file, verify)
if not rc then
- e2lib.abort(re)
+ return false, re
end
else
- e2lib.abort(err.new("Please specify either --files are --git"))
+ return false, err.new("Please specify either --files are --git")
end
return true
e2lib.init()
local info, re = e2tool.local_init(nil, "playground")
if not info then
- e2lib.abort(re)
+ return false, re
end
local e = err.new("entering playground failed")
-- get build mode from the command line
local build_mode = policy.handle_commandline_options(opts, true)
if not build_mode then
- e2lib.abort("no build mode given")
+ return false, err.new("no build mode given")
end
info, re = e2tool.collect_project_info(info)
if not info then
- e2lib.abort(re)
+ return false, re
end
local rc, re = e2tool.check_project_info(info)
if not rc then
- e2lib.abort(re)
+ return false, re
end
if #arguments ~= 1 then
end
rc, re = e2build.build_config(info, r, {})
if not rc then
- e2lib.abort(e:cat(re))
+ return false, e:cat(re)
end
if not e2build.chroot_exists(info, r) then
- e2lib.abort("playground does not exist")
+ return false, err.new("playground does not exist")
end
if opts.showpath then
print(info.results[r].build_config.c)
local profile = string.format("%s/%s", bc.c, bc.profile)
local f, msg = io.open(profile, "w")
if not f then
- e2lib.abort(e:cat(msg))
+ return false, e:cat(msg)
end
f:write(string.format("export TERM='%s'\n", e2lib.globals.osenv["TERM"]))
f:write(string.format("export HOME=/root\n"))
end
rc, re = e2build.enter_playground(info, r, command)
if not rc then
- e2lib.abort(re)
+ return false, re
end
return true