]> git.e2factory.org Git - e2factory.git/commitdiff
Provide global for project-location and use it
authorTobias Ulmer <tu@emlix.com>
Wed, 4 Dec 2013 12:14:57 +0000 (13:14 +0100)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:17 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua
global/e2-fetch-project.lua
local/e2tool.lua

index 4284e0fe5bfe023caa9feaf5ebcf3c65b6fd27c6..9a3d6f00e05f754e095e9b46da099ec346b468c0 100644 (file)
@@ -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,
index 98d803bc0cb5d9f45a4fb50719db7235d3e6071c..dc0e4974c9224a4d7de7942b714cc9179c99e337 100644 (file)
@@ -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
index 65546c48a44a6770974d38968977f4a4620487b3..1b0594a98221b72e06e40335e61617d72df26829 100644 (file)
@@ -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)