From: Tobias Ulmer Date: Fri, 20 Jan 2017 12:45:20 +0000 (+0100) Subject: use e2tool.root() X-Git-Tag: e2factory-2.3.17~57 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=740fb36bd5a02df5b860092bd3935f1dd8e27920;p=e2factory.git use e2tool.root() Signed-off-by: Tobias Ulmer --- diff --git a/local/chroot.lua b/local/chroot.lua index f89448e..20b573a 100644 --- a/local/chroot.lua +++ b/local/chroot.lua @@ -149,7 +149,7 @@ function chroot.load_chroot_config(info) local rc, re, e local t, path, cgroup - path = e2lib.join(info.root, "proj/chroot") + path = e2lib.join(e2tool.root(), "proj/chroot") e = err.new("loading chroot config %q failed", path) t = nil diff --git a/local/e2-cf.lua b/local/e2-cf.lua index 8f8143d..b680168 100644 --- a/local/e2-cf.lua +++ b/local/e2-cf.lua @@ -45,11 +45,11 @@ end local function shadow_config_up(info, src_res, pathname) local cf, cfdir if src_res == "src" then - cf = e2tool.sourceconfig(pathname, info.root) - cfdir = e2tool.sourcedir(pathname, info.root) + cf = e2tool.sourceconfig(pathname, e2tool.root()) + cfdir = e2tool.sourcedir(pathname, e2tool.root()) elseif src_res == "res" then - cf = e2tool.resultconfig(pathname, info.root) - cfdir = e2tool.resultdir(pathname, info.root) + cf = e2tool.resultconfig(pathname, e2tool.root()) + cfdir = e2tool.resultdir(pathname, e2tool.root()) else return false, err.new("unexpected value in src_res") end @@ -76,11 +76,11 @@ end local function shadow_config_down(info, src_res, pathname) local cf, cfdir if src_res == "src" then - cf = e2tool.sourceconfig(pathname, info.root) - cfdir = e2tool.sourcedir(pathname, info.root) + cf = e2tool.sourceconfig(pathname, e2tool.root()) + cfdir = e2tool.sourcedir(pathname, e2tool.root()) elseif src_res == "res" then - cf = e2tool.resultconfig(pathname, info.root) - cfdir = e2tool.resultdir(pathname, info.root) + cf = e2tool.resultconfig(pathname, e2tool.root()) + cfdir = e2tool.resultdir(pathname, e2tool.root()) else return false, err.new("unexpected value in src_res") end @@ -133,8 +133,8 @@ local function newsource(info, ...) end local pathname = e2tool.src_res_name_to_path(name) - local cf = e2tool.sourceconfig(pathname, info.root) - local cfdir = e2tool.sourcedir(pathname, info.root) + local cf = e2tool.sourceconfig(pathname, e2tool.root()) + local cfdir = e2tool.sourcedir(pathname, e2tool.root()) if e2lib.isfile(cf) then return false, e:append("refusing to overwrite config in %s", cfdir) @@ -184,7 +184,7 @@ local function editsource(info, ...) end local pathname = e2tool.src_res_name_to_path(name) - local cf = e2tool.sourceconfig(pathname, info.root) + local cf = e2tool.sourceconfig(pathname, e2tool.root()) return editor(cf) end @@ -204,9 +204,9 @@ local function newresult(info, ...) end local pathname = e2tool.src_res_name_to_path(name) - local cfdir = e2tool.resultdir(pathname, info.root) - local cf = e2tool.resultconfig(pathname, info.root) - local bs = e2tool.resultbuildscript(pathname, info.root) + local cfdir = e2tool.resultdir(pathname, e2tool.root()) + local cf = e2tool.resultconfig(pathname, e2tool.root()) + local bs = e2tool.resultbuildscript(pathname, e2tool.root()) local cftemplate = e2lib.join(info.local_template_path, "result") local bstemplate = e2lib.join(info.local_template_path, "build-script") @@ -282,7 +282,7 @@ local function editresult(info, ...) end local pathname = e2tool.src_res_name_to_path(name) - local cf = e2tool.resultconfig(pathname, info.root) + local cf = e2tool.resultconfig(pathname, e2tool.root()) return editor(cf) end @@ -302,7 +302,7 @@ local function editbuildscript(info, ...) end local pathname = e2tool.src_res_name_to_path(name) - local cf = e2tool.resultbuildscript(pathname, info.root) + local cf = e2tool.resultbuildscript(pathname, e2tool.root()) return editor(cf) end @@ -329,7 +329,7 @@ local function e2_cf(arg) error(re) end - local rc, re = e2lib.chdir(info.root) + local rc, re = e2lib.chdir(e2tool.root()) if not rc then error(re) end diff --git a/local/e2build.lua b/local/e2build.lua index df24dae..edd2083 100644 --- a/local/e2build.lua +++ b/local/e2build.lua @@ -223,7 +223,7 @@ function e2build.build_process_class:_enter_playground(res, return_flags) bc = res:build_config() e = err.new("entering playground") - + rc, re = eio.file_write(e2lib.join(bc.c, bc.profile), res:build_settings():profile()) if not rc then @@ -373,7 +373,7 @@ function e2build.build_process_class:helper_chroot_remove(res) if not rc then return false, e:cat(re) end - local f = e2lib.join(info.root, "playground") + local f = e2lib.join(e2tool.root(), "playground") local s = e2lib.lstat(f) if s and s.type == "symbolic-link" then rc, re = e2lib.unlink(f) @@ -519,14 +519,14 @@ function e2build.build_process_class:_install_init_files(res, return_flags) info = e2tool.info() - for x, re in e2lib.directory(info.root .. "/proj/init") do + for x, re in e2lib.directory(e2tool.root() .. "/proj/init") do if not x then return false, e:cat(re) end if not e2lib.is_backup_file(x) then local location = e2lib.join("proj/init", x) - local abslocation = e2lib.join(info.root, location) + local abslocation = e2lib.join(e2tool.root(), location) local destdir = e2lib.join(bc.T, "init") if not e2lib.isfile(abslocation) then @@ -570,7 +570,7 @@ function e2build.build_process_class:_install_build_driver(res, return_flags) -- init files info = e2tool.info() - for fn, re in e2lib.directory(e2lib.join(info.root, "proj/init")) do + for fn, re in e2lib.directory(e2lib.join(e2tool.root(), "proj/init")) do if not fn then return false, e:cat(re) end @@ -1063,7 +1063,7 @@ function e2build.build_process_class:_linklast(res, return_flags) if not buildid then return false, e:cat(re) end - lnk = e2lib.join(info.root, "out", res:get_name(), "last") + lnk = e2lib.join(e2tool.root(), "out", res:get_name(), "last") location = e2lib.join(location, res:get_name(), buildid, "result.tar") -- if we don't have cache or server on local fs, fetch a copy into "out" diff --git a/local/e2tool.lua b/local/e2tool.lua index d65f20e..dbab708 100644 --- a/local/e2tool.lua +++ b/local/e2tool.lua @@ -639,12 +639,12 @@ local _info = false local function opendebuglogfile(info) local rc, re, e, logfile, debuglogfile - rc, re = e2lib.mkdir_recursive(e2lib.join(info.root, "log")) + rc, re = e2lib.mkdir_recursive(e2lib.join(e2tool.root(), "log")) if not rc then e = err.new("error making log directory") return false, e:cat(re) end - logfile = e2lib.join(info.root, "log/debug.log") + logfile = e2lib.join(e2tool.root(), "log/debug.log") rc, re = e2lib.rotate_log(logfile) if not rc then return false, re @@ -755,12 +755,13 @@ function e2tool.local_init(path, tool) if not info.root then return false, e:append("not located in a project directory") end + e2tool.root(info.root) -- load local plugins local ctx = { -- plugin context info = info, } - local plugindir = e2lib.join(info.root, ".e2/plugins") + local plugindir = e2lib.join(e2tool.root(), ".e2/plugins") rc, re = plugin.load_plugins(plugindir, ctx) if not rc then return false, e:cat(re) @@ -783,7 +784,7 @@ local function check_config_syntax_compat(info) local re, e, sf, l e = err.new("checking configuration syntax compatibilitly failed") - sf = e2lib.join(info.root, e2lib.globals.syntax_file) + sf = e2lib.join(e2tool.root(), e2lib.globals.syntax_file) l, re = eio.file_read_line(sf) if not l then @@ -940,7 +941,7 @@ function e2tool.collect_project_info(info, skip_load_config) e2lib.finish(1) end - info.local_template_path = e2lib.join(info.root, ".e2/lib/e2/templates") + info.local_template_path = e2lib.join(e2tool.root(), ".e2/lib/e2/templates") rc, re = e2lib.init2() -- configuration must be available if not rc then @@ -960,7 +961,7 @@ function e2tool.collect_project_info(info, skip_load_config) e2lib.logf(4, "VERSIONSTRING: %s", buildconfig.VERSIONSTRING) -- read .e2/proj-location - local plf = e2lib.join(info.root, e2lib.globals.project_location_file) + local plf = e2lib.join(e2tool.root(), e2lib.globals.project_location_file) local line, re = eio.file_read_line(plf) if not line then return false, e:cat(re) @@ -983,7 +984,7 @@ function e2tool.collect_project_info(info, skip_load_config) return false, e:cat(re) end - rc, re = cache.setup_cache_local(info.cache, info.root, info.project_location) + rc, re = cache.setup_cache_local(info.cache, e2tool.root(), info.project_location) if not rc then return false, e:cat(re) end @@ -993,7 +994,7 @@ function e2tool.collect_project_info(info, skip_load_config) return false, e:cat(re) end - local f = e2lib.join(info.root, e2lib.globals.e2version_file) + local f = e2lib.join(e2tool.root(), e2lib.globals.e2version_file) local v, re = e2lib.parse_e2versionfile(f) if not v then return false, re @@ -1059,7 +1060,7 @@ function e2tool.collect_project_info(info, skip_load_config) -- read global interface version and check if this version of the local -- tools supports the version used for the project - local givf = e2lib.join(info.root, e2lib.globals.global_interface_version_file) + local givf = e2lib.join(e2tool.root(), e2lib.globals.global_interface_version_file) local line, re = eio.file_read_line(givf) if not line then return false, e:cat(re) @@ -1089,7 +1090,7 @@ function e2tool.collect_project_info(info, skip_load_config) ".e2/version", } for _,f in ipairs(deprecated_files) do - local path = e2lib.join(info.root, f) + local path = e2lib.join(e2tool.root(), f) if e2lib.exists(path) then e2lib.warnf("WDEPRECATED", "File exists but is no longer used: `%s'", f) end @@ -1103,7 +1104,7 @@ function e2tool.collect_project_info(info, skip_load_config) if e2option.opts["check"] then local dirty, mismatch - rc, re, mismatch = generic_git.verify_head_match_tag(info.root, + rc, re, mismatch = generic_git.verify_head_match_tag(e2tool.root(), project.release_id()) if not rc then if mismatch then @@ -1114,7 +1115,7 @@ function e2tool.collect_project_info(info, skip_load_config) end end - rc, re, dirty = generic_git.verify_clean_repository(info.root) + rc, re, dirty = generic_git.verify_clean_repository(e2tool.root()) if not rc then if dirty then e = err.new("project repository is not clean") @@ -1127,7 +1128,7 @@ function e2tool.collect_project_info(info, skip_load_config) if e2option.opts["check-remote"] then rc, re = generic_git.verify_remote_tag( - e2lib.join(info.root, ".git"), project.release_id()) + e2lib.join(e2tool.root(), ".git"), project.release_id()) if not rc then e:append("verifying remote tag failed") return false, e:cat(re) diff --git a/local/licence.lua b/local/licence.lua index 53b011f..60fb12c 100644 --- a/local/licence.lua +++ b/local/licence.lua @@ -126,7 +126,7 @@ function licence.load_licence_config(info) local rc, re, e local path, ltable - path = e2lib.join(info.root, "proj/licences") + path = e2lib.join(e2tool.root(), "proj/licences") e2lib.logf(3, "loading licence config %q", path) e = err.new("loading licence config %q failed", path) diff --git a/local/project.lua b/local/project.lua index 2ef5f5b..75b5f7b 100644 --- a/local/project.lua +++ b/local/project.lua @@ -167,7 +167,7 @@ function project.load_project_config(info) return false, re end - path = e2lib.join(info.root, "proj/config") + path = e2lib.join(e2tool.root(), "proj/config") prj = nil local g = { @@ -252,7 +252,7 @@ function project.chroot_call_prefix() assert(info) if project.chroot_arch() == "x86_32" then - return e2lib.join(info.root, ".e2/bin/e2-linux32") + return e2lib.join(e2tool.root(), ".e2/bin/e2-linux32") end return "" @@ -322,7 +322,7 @@ function project.projid(info) -- catch proj/init/* hc = hash.hash_start() - for f, re in e2lib.directory(e2lib.join(info.root, "proj/init")) do + for f, re in e2lib.directory(e2lib.join(e2tool.root(), "proj/init")) do if not f then return false, re end @@ -349,7 +349,7 @@ function project.projid(info) -- .e2/extensions local extensions - extensions, re = e2lib.read_extension_config(info.root) + extensions, re = e2lib.read_extension_config(e2tool.root()) if not extensions then return false, re end diff --git a/local/projenv.lua b/local/projenv.lua index 9c01ccf..606826a 100644 --- a/local/projenv.lua +++ b/local/projenv.lua @@ -127,7 +127,7 @@ local function _load_env_config(file) end local info = e2tool.info() - local path = e2lib.join(info.root, file) + local path = e2lib.join(e2tool.root(), file) local mt = { __index = function(t, key) diff --git a/local/result.lua b/local/result.lua index bb07af6..b2a53db 100644 --- a/local/result.lua +++ b/local/result.lua @@ -319,7 +319,7 @@ function result.result_class:initialize(rawres) end local build_script = - e2tool.resultbuildscript(self:get_name_as_path(), info.root) + e2tool.resultbuildscript(self:get_name_as_path(), e2tool.root()) if not e2lib.isfile(build_script) then e:append("build-script does not exist: %s", build_script) end @@ -390,7 +390,7 @@ function result.result_class:build_config() bc.Tc = e2lib.join("/", builddir) bc.r = self:get_name() bc.chroot_call_prefix = project.chroot_call_prefix() - bc.buildlog = string.format("%s/log/build.%s.log", info.root, self:get_name()) + bc.buildlog = string.format("%s/log/build.%s.log", e2tool.root(), self:get_name()) bc.scriptdir = "script" bc.build_driver_file = "build-driver" bc.buildrc_file = "buildrc" @@ -583,7 +583,7 @@ local function gather_result_paths(info, basedir, results) local currdir, resdir, resconfig, s results = results or {} - currdir = e2tool.resultdir(basedir, info.root) + currdir = e2tool.resultdir(basedir, e2tool.root()) for entry, re in e2lib.directory(currdir) do if not entry then return false, re @@ -593,8 +593,8 @@ local function gather_result_paths(info, basedir, results) entry = e2lib.join(basedir, entry) end - resdir = e2tool.resultdir(entry, info.root) - resconfig = e2tool.resultconfig(entry, info.root) + resdir = e2tool.resultdir(entry, e2tool.root()) + resconfig = e2tool.resultconfig(entry, e2tool.root()) s = e2lib.stat(resdir) if s.type == "directory" then if e2lib.exists(resconfig) then @@ -635,7 +635,7 @@ local function load_rawres(cfg) string = e2lib.safe_string_table(), } - path = e2tool.resultconfig(cfg, info.root) + path = e2tool.resultconfig(cfg, e2tool.root()) rc, re = e2lib.dofile2(path, g) if not rc then return false, e:cat(re) diff --git a/local/source.lua b/local/source.lua index 39cf7ac..0f4fd0b 100644 --- a/local/source.lua +++ b/local/source.lua @@ -154,7 +154,7 @@ local function gather_source_paths(info, basedir, sources) local currdir, sdir, sconfig, s sources = sources or {} - currdir = e2tool.sourcedir(basedir, info.root) + currdir = e2tool.sourcedir(basedir, e2tool.root()) for entry, re in e2lib.directory(currdir) do if not entry then return false, re @@ -164,8 +164,8 @@ local function gather_source_paths(info, basedir, sources) entry = e2lib.join(basedir, entry) end - sdir = e2tool.sourcedir(entry, info.root) - sconfig = e2tool.sourceconfig(entry, info.root) + sdir = e2tool.sourcedir(entry, e2tool.root()) + sconfig = e2tool.sourceconfig(entry, e2tool.root()) s = e2lib.stat(sdir) if s.type == "directory" then if e2lib.exists(sconfig) then @@ -215,7 +215,7 @@ function source.load_source_configs(info) string = e2lib.safe_string_table(), } - path = e2tool.sourceconfig(cfg, info.root) + path = e2tool.sourceconfig(cfg, e2tool.root()) rc, re = e2lib.dofile2(path, g) if not rc then return false, e:cat(re) diff --git a/plugins/collect_project.lua b/plugins/collect_project.lua index 2d5f70d..82d0b90 100644 --- a/plugins/collect_project.lua +++ b/plugins/collect_project.lua @@ -73,7 +73,7 @@ local function _build_collect_project(self, res, return_flags) return false, e:cat(re) end - for fn, re in e2lib.directory(e2lib.join(info.root, "proj/init")) do + for fn, re in e2lib.directory(e2lib.join(e2tool.root(), "proj/init")) do if not fn then return false, e:cat(re) end @@ -149,7 +149,7 @@ local function _build_collect_project(self, res, return_flags) return false, e:cat(re) end - for f, re in e2lib.directory(e2lib.join(info.root, "proj/init"), false) do + for f, re in e2lib.directory(e2lib.join(e2tool.root(), "proj/init"), false) do if not f then return false, e:cat(re) end diff --git a/plugins/cvs.lua b/plugins/cvs.lua index f04d9a5..67c53a9 100644 --- a/plugins/cvs.lua +++ b/plugins/cvs.lua @@ -333,7 +333,7 @@ function cvs.fetch_source(info, sourcename) -- split the working directory into dirname and basename as some cvs clients -- don't like slashes (e.g. in/foo) in their checkout -d argument - workdir = e2lib.dirname(e2lib.join(info.root, src:get_working())) + workdir = e2lib.dirname(e2lib.join(e2tool.root(), src:get_working())) argv = { "-d", cvsroot, @@ -394,7 +394,7 @@ function cvs.prepare_source(info, sourcename, sourceset, buildpath) return false, e:cat(re) end elseif sourceset == "working-copy" then - rc, re = e2lib.cp(e2lib.join(info.root, src:get_working()), + rc, re = e2lib.cp(e2lib.join(e2tool.root(), src:get_working()), e2lib.join(buildpath, src:get_name()), true) if not rc then return false, e:cat(re) @@ -416,7 +416,7 @@ function cvs.update(info, sourcename) return false, e:cat(re) end - workdir = e2lib.join(info.root, src:get_working()) + workdir = e2lib.join(e2tool.root(), src:get_working()) argv = { "update", "-R" } rc, re = cvs_tool(argv, workdir) @@ -429,7 +429,7 @@ end function cvs.working_copy_available(info, sourcename) local src = source.sources[sourcename] - local dir = e2lib.join(info.root, src:get_working()) + local dir = e2lib.join(e2tool.root(), src:get_working()) if not e2lib.isdir(dir) then return false, err.new("working copy for %s is not available", sourcename) end diff --git a/plugins/git.lua b/plugins/git.lua index 5d9f017..5ef7475 100644 --- a/plugins/git.lua +++ b/plugins/git.lua @@ -299,7 +299,7 @@ function git.git_commit_id(info, sourcename, sourceset, check_remote) return false, e:cat(re) end - gitdir = e2lib.join(info.root, src:get_working(), ".git") + gitdir = e2lib.join(e2tool.root(), src:get_working(), ".git") if sourceset == "branch" or (sourceset == "lazytag" and src:get_tag() == "^") then ref = string.format("refs/heads/%s", src:get_branch()) @@ -353,7 +353,7 @@ function git.update(info, sourcename) e2lib.logf(2, "updating %s [%s]", src:get_working(), src:get_branch()) - gitwc = e2lib.join(info.root, src:get_working()) + gitwc = e2lib.join(e2tool.root(), src:get_working()) gitdir = e2lib.join(gitwc, ".git") argv = generic_git.git_new_argv(gitdir, gitwc, "fetch") @@ -422,7 +422,7 @@ function git.fetch_source(info, sourcename) src = source.sources[sourcename] e = err.new("fetching source failed: %s", sourcename) - work_tree = e2lib.join(info.root, src:get_working()) + work_tree = e2lib.join(e2tool.root(), src:get_working()) git_dir = e2lib.join(work_tree, ".git") e2lib.logf(2, "cloning %s:%s [%s]", src:get_server(), src:get_location(), @@ -474,7 +474,7 @@ function git.prepare_source(info, sourcename, sourceset, buildpath) return false, e:cat(re) end - srcdir = e2lib.join(info.root, src:get_working()) + srcdir = e2lib.join(e2tool.root(), src:get_working()) destdir = e2lib.join(buildpath, sourcename) rc, re = e2lib.mkdir_recursive(destdir) @@ -485,7 +485,7 @@ function git.prepare_source(info, sourcename, sourceset, buildpath) if sourceset == "working-copy" then local empty - srcdir = e2lib.join(info.root, src:get_working()) + srcdir = e2lib.join(e2tool.root(), src:get_working()) empty = true for f, re in e2lib.directory(srcdir, true) do @@ -627,7 +627,7 @@ end function git.working_copy_available(info, sourcename) local rc local src = source.sources[sourcename] - local gitwc = e2lib.join(info.root, src:get_working()) + local gitwc = e2lib.join(e2tool.root(), src:get_working()) if not e2lib.isdir(gitwc) then return false, err.new("working copy for %s is not available", sourcename) @@ -690,7 +690,7 @@ function git.toresult(info, sourcename, sourceset, directory) return false, e:cat(re) end - argv = generic_git.git_new_argv(nil, e2lib.join(info.root, src:get_working())) + argv = generic_git.git_new_argv(nil, e2lib.join(e2tool.root(), src:get_working())) table.insert(argv, "archive") table.insert(argv, "--format=tar") -- older versions don't have "tar.gz" table.insert(argv, string.format("--prefix=%s/", sourcename)) @@ -714,7 +714,7 @@ function git.toresult(info, sourcename, sourceset, directory) end elseif sourceset == "working-copy" then argv = { - "-C", e2lib.join(info.root, src:get_working()), + "-C", e2lib.join(e2tool.root(), src:get_working()), string.format("--transform=s,^./,./%s/,", sourcename), "--exclude=.git", "-czf", @@ -768,7 +768,7 @@ function git.check_workingcopy(info, sourcename) -- check if branch exists local src = source.sources[sourcename] - local gitdir = e2lib.join(info.root, src:get_working(), ".git") + local gitdir = e2lib.join(e2tool.root(), src:get_working(), ".git") local ref = string.format("refs/heads/%s", src:get_branch()) local id diff --git a/plugins/gitrepo.lua b/plugins/gitrepo.lua index 753db21..96e37a4 100644 --- a/plugins/gitrepo.lua +++ b/plugins/gitrepo.lua @@ -233,7 +233,7 @@ function gitrepo.working_copy_available(info, sourcename) local src = source.sources[sourcename] - if not e2lib.isdir(e2lib.join(info.root, src:get_working())) then + if not e2lib.isdir(e2lib.join(e2tool.root(), src:get_working())) then return false, err.new("working copy for %s is not available", sourcename) end return true @@ -257,7 +257,7 @@ function gitrepo.fetch_source(info, sourcename) src = source.sources[sourcename] e = err.new("fetching source failed: %s", sourcename) - work_tree = e2lib.join(info.root, src:get_working()) + work_tree = e2lib.join(e2tool.root(), src:get_working()) git_dir = e2lib.join(work_tree, ".git") e2lib.logf(2, "cloning %s:%s [%s]", src:get_server(), src:get_location(), @@ -324,7 +324,7 @@ function gitrepo.prepare_source(info, sourcename, sourceset, buildpath) return false, e:cat(re) end - worktree = e2lib.join(info.root, src:get_working()) + worktree = e2lib.join(e2tool.root(), src:get_working()) argv = generic_git.git_new_argv(false, false, "clone", "--mirror", worktree, destdir) rc, re = generic_git.git(argv) @@ -350,7 +350,7 @@ function gitrepo.prepare_source(info, sourcename, sourceset, buildpath) elseif sourceset == "working-copy" then local argv = { "-a", - e2lib.join(info.root, src:get_working(), ""), + e2lib.join(e2tool.root(), src:get_working(), ""), e2lib.join(buildpath, sourcename), } rc, re = e2lib.rsync(argv) @@ -383,7 +383,7 @@ function gitrepo.update(info, sourcename) e2lib.logf(2, "updating %s [%s]", src:get_working(), src:get_branch()) - gitwc = e2lib.join(info.root, src:get_working()) + gitwc = e2lib.join(e2tool.root(), src:get_working()) gitdir = e2lib.join(gitwc, ".git") argv = generic_git.git_new_argv(gitdir, gitwc, "fetch") @@ -473,7 +473,7 @@ function gitrepo.check_workingcopy(info, sourcename) -- check if branch exists local src = source.sources[sourcename] - local gitdir = e2lib.join(info.root, src:get_working(), ".git") + local gitdir = e2lib.join(e2tool.root(), src:get_working(), ".git") local ref = string.format("refs/heads/%s", src:get_branch()) local id @@ -562,7 +562,7 @@ function gitrepo.toresult(info, sourcename, sourceset, directory) if sourceset == "tag" or sourceset == "branch" then local tmpdir = e2lib.mktempdir() - local worktree = e2lib.join(info.root, src:get_working()) + local worktree = e2lib.join(e2tool.root(), src:get_working()) local destdir = e2lib.join(tmpdir, sourcename, ".git") rc, re = e2lib.mkdir_recursive(destdir) @@ -584,7 +584,7 @@ function gitrepo.toresult(info, sourcename, sourceset, directory) end elseif sourceset == "working-copy" then rc, rc = e2lib.tar({"-czf", e2lib.join(sourcedir, archive), - "-C", e2lib.join(info.root, src:get_working(), ".."), sourcename}) + "-C", e2lib.join(e2tool.root(), src:get_working(), ".."), sourcename}) if not rc then return false, e:cat(re) end diff --git a/plugins/svn.lua b/plugins/svn.lua index c64cf29..a54010e 100644 --- a/plugins/svn.lua +++ b/plugins/svn.lua @@ -388,7 +388,7 @@ function svn.fetch_source(info, sourcename) return true end - local argv = { "checkout", svnurl, info.root .. "/" .. src:get_working() } + local argv = { "checkout", svnurl, e2tool.root() .. "/" .. src:get_working() } rc, re = svn_tool(argv) if not rc then @@ -425,8 +425,8 @@ function svn.prepare_source(info, sourcename, sourceset, build_path) return false, e:cat(re) end elseif sourceset == "working-copy" then - -- cp -R info.root/src.working/src.workingcopy_subdir build_path - local s = e2lib.join(info.root, src:get_working(), + -- cp -R e2tool.root()/src.working/src.workingcopy_subdir build_path + local s = e2lib.join(e2tool.root(), src:get_working(), src:get_workingcopy_subdir()) local d = e2lib.join(build_path, src:get_name()) rc, re = e2lib.cp(s, d, true) @@ -443,7 +443,7 @@ function svn.working_copy_available(info, sourcename) local rc, re local src = source.sources[sourcename] - local dir = e2lib.join(info.root, src:get_working()) + local dir = e2lib.join(e2tool.root(), src:get_working()) if not e2lib.isdir(dir) then return false, err.new("working copy for %s is not available", sourcename) end @@ -461,11 +461,11 @@ function svn.check_workingcopy(info, sourcename) end -- check if the configured branch and tag exist local d - d = e2lib.join(info.root, src:get_working(), src:get_branch()) + d = e2lib.join(e2tool.root(), src:get_working(), src:get_branch()) if not e2lib.isdir(d) then e:append("branch does not exist: %s", src:get_branch()) end - d = e2lib.join(info.root, src:get_working(), src:get_tag()) + d = e2lib.join(e2tool.root(), src:get_working(), src:get_tag()) if not e2lib.isdir(d) then e:append("tag does not exist: %s", src:get_tag()) end @@ -539,7 +539,7 @@ function svn.update(info, sourcename) local rc, re local e = err.new("updating source '%s' failed", sourcename) local src = source.sources[sourcename] - local workdir = e2lib.join(info.root, src:get_working()) + local workdir = e2lib.join(e2tool.root(), src:get_working()) rc, re = svn_tool({ "update" }, workdir) if not rc then return false, e:cat(re)