end
--- init2.
+-- @return True on success, false on error.
+-- @return Error object on failure.
function e2lib.init2()
local rc, re
local e = err.new("initializing globals (step2)")
-- initialize the tools library after resetting tools
local rc, re = tools.init()
if not rc then
- e2lib.abort(e:cat(re))
+ return false, e:cat(re)
end
-- get host system architecture
local host_system_arch, re = e2lib.get_sys_arch()
if not host_system_arch then
- e2lib.abort(e:cat(re))
+ return false, e:cat(re)
end
+
+ return true
end
--- function call tracer
if not rc then
return false, e
end
- e2lib.init2()
+
+ rc, re = e2lib.init2()
+ if not rc then
+ return false, re
+ end
+
local e = err.new("creating project failed")
local config, re = e2lib.get_global_config()
return false, arguments
end
- local rc, re = e2lib.read_global_config()
+ rc, re = e2lib.read_global_config()
if not rc then
return false, e:cat(re)
end
- e2lib.init2()
+
+ rc, re = e2lib.init2()
+ if not rc then
+ return false, re
+ end
-- get the global configuration
local config = e2lib.get_global_config()
if not rc then
return false, e
end
- e2lib.init2()
+
+ rc, re = e2lib.init2()
+ if not rc then
+ return false, re
+ end
+
local e = err.new("e2-install-e2 failed")
local config = e2lib.get_global_config()
info.local_template_path = e2lib.join(info.root, "/.e2/lib/e2/templates")
- e2lib.init2() -- configuration must be available
+ rc, re = e2lib.init2() -- configuration must be available
+ if not rc then
+ return false, re
+ end
if skip_load_config == true then
return info