]> git.e2factory.org Git - e2factory.git/commitdiff
project: move chroot_call_prefix() to better location
authorTobias Ulmer <tu@emlix.com>
Tue, 30 Aug 2016 16:53:40 +0000 (18:53 +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>
local/e2tool.lua
local/project.lua

index 9ad5375dd0c5fff7f9288b639461e4d2cde078ac..4d97518e0940f1b7f6c0f55b86b9cb390aeb72d5 100644 (file)
@@ -525,15 +525,6 @@ function e2tool.collect_project_info(info, skip_load_config)
     rc = cache.new_cache_entry(info.cache, info.proj_storage_server_name,
         nil, nil, info.default_repo_server, info.project_location)
 
-    -- prefix the chroot call with this tool (switch to 32bit on amd64)
-    -- XXX not in buildid, as it is filesystem location dependent...
-    info.chroot_call_prefix = {}
-    info.chroot_call_prefix["x86_32"] =
-        e2lib.join(info.root, ".e2/bin/e2-linux32")
-    -- either we are on x86_64 or we are on x86_32 and refuse to work anyway
-    -- if x86_64 mode is requested.
-    info.chroot_call_prefix["x86_64"] = ""
-
     local f = e2lib.join(info.root, e2lib.globals.e2version_file)
     local v, re = e2lib.parse_e2versionfile(f)
     if not v then
index c3031a26a7227629b77e50390254e1113276af00..055a22acc02eefdf093b14c0702103ea0a23cedc 100644 (file)
@@ -19,6 +19,7 @@
 -- more details.
 
 local project = {}
+package.loaded["project"] = project
 
 local buildconfig = require("buildconfig")
 local e2lib = require("e2lib")
@@ -102,8 +103,9 @@ local function load_prj_cfg(prj)
         e2lib.warnf("WDEFAULT", " chroot_arch defaults to x86_32")
         prj.chroot_arch = "x86_32"
     end
-    if not info.chroot_call_prefix[prj.chroot_arch] then
-        return false, err.new("chroot_arch is set to an invalid value")
+
+    if prj.chroot_arch ~= "x86_32" and prj.chroot_arch ~= "x86_64" then
+        return false, err.new("chroot_arch is set to an unknown architecture")
     end
 
     -- get host system architecture
@@ -186,6 +188,18 @@ function project.chroot_arch()
     return _prj.chroot_arch
 end
 
+function project.chroot_call_prefix()
+    local info
+    info = e2tool.info()
+    assert(info)
+
+    if project.chroot_arch() == "x86_32" then
+       return e2lib.join(info.root, ".e2/bin/e2-linux32")
+    end
+
+    return ""
+end
+
 --- Iterator that returns the deploy results as string.
 -- @return Iterator function.
 function project.deploy_results_iter()