]> git.e2factory.org Git - e2factory.git/commitdiff
Provide global for e2version file and use it
authorTobias Ulmer <tu@emlix.com>
Wed, 4 Dec 2013 13:23:39 +0000 (14:23 +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-create-project.lua
global/e2-install-e2.lua
local/e2-build.lua
local/e2tool.lua

index 9a3d6f00e05f754e095e9b46da099ec346b468c0..79735b461a37e16e0bae5a1678e8e251eb619f38 100644 (file)
@@ -86,6 +86,7 @@ e2lib.globals = strict.lock({
     e2config = false,
     global_interface_version_file = ".e2/global-version",
     project_location_file = ".e2/project-location",
+    e2version_file = ".e2/e2version",
     logrotate = 5,   -- configurable via config.log.logrotate
     _version = "e2factory, the emlix embedded build system, version " ..
     buildconfig.VERSION,
index 9823911fa4f813a891aa2136eba94cad2aa6a738..41de794922fec75f18dae65cddfbe63ce1fe03d9 100644 (file)
@@ -259,7 +259,7 @@ local function e2_create_project(arg)
         { filename = "proj/env", content=env },
         { filename = "proj/config", content=pconfig },
         { filename = ".e2/syntax", content=syntax },
-        { filename = ".e2/e2version", content=e2version },
+        { filename = e2lib.globals.e2version_file, content=e2version },
         { filename = ".gitignore", content=gitignore },
     }
     for _,f in ipairs(files) do
index 014a5c4c3f8c458b757718613bf2a712185c02f4..457e554ead455e243e0e252dc6f7def29438835c 100644 (file)
@@ -127,7 +127,8 @@ local function e2_install_e2(arg)
         extensions = {}  -- empty list
     end
 
-    local s, re = eio.file_read_line(".e2/e2version")
+    local ef = e2lib.join(root, e2lib.globals.e2version_file)
+    local s, re = eio.file_read_line(ef)
     local branch, tag = s:match("(%S+) (%S+)")
     if not branch or not tag then
         e:cat(re)
index 168793d840383a6c1c59417c16d3d6cae7539c98..13ba36ca667ad928a6aec18039347ade1d76a084 100644 (file)
@@ -199,7 +199,7 @@ local function e2_build(arg)
 
     if opts.release then
         local version_table, re = e2lib.parse_e2versionfile(
-            e2lib.join(info.root, ".e2/e2version"))
+            e2lib.join(info.root, e2lib.globals.e2version_file))
         if not version_table then
             return false, re
         end
index 1b0594a98221b72e06e40335e61617d72df26829..f3000a3ede53dcabcac77e51ace0d233cb6caeb9 100644 (file)
@@ -1342,7 +1342,7 @@ function e2tool.collect_project_info(info, skip_load_config)
     end
 
     if e2option.opts["check"] then
-        local f = ".e2/e2version"
+        local f = e2lib.join(info.root, e2lib.globals.e2version_file)
         local v, re = e2lib.parse_e2versionfile(f)
         if not v then
             return false, re