]> git.e2factory.org Git - e2factory.git/commitdiff
project: move host system architecture check here
authorTobias Ulmer <tu@emlix.com>
Wed, 15 Jun 2016 14:18:43 +0000 (16:18 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:18 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua
local/project.lua

index 0f928265ae085cf1fd1e8e893736d86271d65387..1be1fa336d6f8d4677971b3be50e5288e89f9585 100644 (file)
@@ -428,7 +428,7 @@ end
 -- @return True on success, false on error.
 -- @return Error object on failure.
 function e2lib.init2()
-    local rc, re, e, config, ssh, host_system_arch
+    local rc, re, e, config, ssh
 
     e = err.new("initializing globals (step2)")
 
@@ -464,12 +464,6 @@ function e2lib.init2()
         return false, e:cat(re)
     end
 
-    -- get host system architecture
-    host_system_arch, re = e2lib.uname_machine()
-    if not host_system_arch then
-        return false, e:cat(re)
-    end
-
     return true
 end
 
index e703b7356f91fbca7ef624d91ef023018f09f216..29f39a135a47004d44203d07894dcdc8f6e0700a 100644 (file)
@@ -55,7 +55,7 @@ end
 -- @return True on success, false on error.
 -- @return Error object on failure.
 local function load_prj_cfg(prj)
-    local rc, re, e, info
+    local rc, re, e, info, system_arch
 
     info = e2tool.info()
     assert(info)
@@ -103,7 +103,13 @@ local function load_prj_cfg(prj)
     if not info.chroot_call_prefix[prj.chroot_arch] then
         return false, err.new("chroot_arch is set to an invalid value")
     end
-    if prj.chroot_arch == "x86_64" and e2lib.host_system_arch ~= "x86_64" then
+
+    -- get host system architecture
+    system_arch, re = e2lib.uname_machine()
+    if not system_arch then
+        return false, re
+    end
+    if prj.chroot_arch == "x86_64" and system_arch ~= "x86_64" then
         return false,
             err.new("running on x86_32: switching to x86_64 mode is impossible.")
     end