e2option.usage(1)
end
- -- change to the project root directory
- rc, re = e2lib.chdir(root)
- if not rc then
- return false, e:cat(re)
- end
-
-- read the version from the first line
local givf = e2lib.join(root, e2lib.globals.global_interface_version_file)
local line, re = eio.file_read_line(givf)
-- remove the old e2 source, installation and plugins, if it exists
for _,dir in ipairs({".e2/e2", ".e2/bin", ".e2/lib", ".e2/plugins"}) do
+ dir = e2lib.join(root, dir)
if e2lib.exists(dir) then
rc, re = e2lib.unlink_recursive(dir)
if not rc then
ref = string.format("refs/tags/%s", e2version.tag)
end
- rc, re = e2lib.chdir(".e2")
- if not rc then
- return false, e:cat(re)
- end
-
-- checkout e2factory itself
local server = config.site.e2_server
local location = config.site.e2_location
if not rc then
return false, e:cat(re)
end
- e2lib.chdir(destdir)
-- change to requested branch or tag
rc, re = generic_git.git_checkout1(destdir, ref)
end
for _,ex in ipairs(extensions) do
- -- change to the e2factory extensions directory
- rc, re = e2lib.chdir(root .. "/.e2/e2/extensions")
- if not rc then
- return false, e:cat(re)
- end
local ref
if ex.ref:match("/") then
ref = ex.ref
if not rc then
return false, e:cat(re)
end
- e2lib.chdir(destdir)
rc, re = generic_git.git_checkout1(destdir, ref)
if not rc then
-- build and install
e2lib.logf(2, "building e2factory")
- rc, re = e2lib.chdir(root .. "/.e2/e2")
- if not rc then
- return false, e:cat(re)
- end
+
local cmd = {
buildconfig.MAKE,
"PREFIX="..buildconfig.PREFIX,
"install-local",
}
- rc, re = e2lib.callcmd_log(cmd)
+ rc, re = e2lib.callcmd_log(cmd, e2lib.join(root, ".e2/e2"))
if not rc or rc ~= 0 then
return false, e:cat(re)
end