From: Tobias Ulmer Date: Wed, 4 Dec 2013 12:14:57 +0000 (+0100) Subject: Provide global for project-location and use it X-Git-Tag: e2factory-2.3.15rc1~310 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=b0b55b40ddd6a5a73722c4ef885193143d87b18a;p=e2factory.git Provide global for project-location and use it Signed-off-by: Tobias Ulmer --- diff --git a/generic/e2lib.lua b/generic/e2lib.lua index 4284e0f..9a3d6f0 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -85,6 +85,7 @@ e2lib.globals = strict.lock({ extension_config = ".e2/extensions", e2config = false, global_interface_version_file = ".e2/global-version", + project_location_file = ".e2/project-location", logrotate = 5, -- configurable via config.log.logrotate _version = "e2factory, the emlix embedded build system, version " .. buildconfig.VERSION, diff --git a/global/e2-fetch-project.lua b/global/e2-fetch-project.lua index 98d803b..dc0e497 100644 --- a/global/e2-fetch-project.lua +++ b/global/e2-fetch-project.lua @@ -195,9 +195,9 @@ local function e2_fetch_project(arg) end -- write project location file - local file = ".e2/project-location" + local plf = e2lib.join(p.destdir, e2lib.globals.project_location_file) local data = string.format("%s\n", p.location) - rc, re = eio.file_write(file, data) + rc, re = eio.file_write(plf, data) if not rc then return false, e:cat(re) end diff --git a/local/e2tool.lua b/local/e2tool.lua index 65546c4..1b0594a 100644 --- a/local/e2tool.lua +++ b/local/e2tool.lua @@ -1426,15 +1426,14 @@ function e2tool.collect_project_info(info, skip_load_config) end -- read .e2/proj-location - info.project_location_config = e2lib.join(info.root, ".e2/project-location") - local line, re = eio.file_read_line(info.project_location_config) + local plf = e2lib.join(info.root, e2lib.globals.project_location_file) + local line, re = eio.file_read_line(plf) if not line then return false, e:cat(re) end local _, _, l = string.find(line, "^%s*(%S+)%s*$") if not l then - return false, e:append("%s: can't parse project location", - info.project_location_config) + return false, e:append("%s: can't parse project location", plf) end info.project_location = l e2lib.logf(4, "project location is %s", info.project_location)