]> git.e2factory.org Git - e2factory.git/commitdiff
Initialize the cache early
authorTobias Ulmer <tu@emlix.com>
Tue, 11 Feb 2014 13:52:47 +0000 (14:52 +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>
local/e2tool.lua

index ffb535ce461b0c45aac5a51d47d2ae5e12fc8923..d9647560ed84457c0a895f697e5222aa4c1fa704 100644 (file)
@@ -1239,6 +1239,29 @@ function e2tool.collect_project_info(info, skip_load_config)
     info.default_repo_server = "projects"
     info.default_files_server = "upstream"
 
+    -- read .e2/proj-location
+    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", plf)
+    end
+    info.project_location = l
+    e2lib.logf(4, "project location is %s", info.project_location)
+
+    -- setup cache
+    info.cache, re = e2lib.setup_cache()
+    if not info.cache then
+        return false, e:cat(re)
+    end
+    rc = cache.new_cache_entry(info.cache, info.root_server_name,
+        info.root_server, { writeback=true },  nil, nil )
+    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 = {}
@@ -1327,19 +1350,6 @@ function e2tool.collect_project_info(info, skip_load_config)
         return false, e
     end
 
-    -- read .e2/proj-location
-    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", plf)
-    end
-    info.project_location = l
-    e2lib.logf(4, "project location is %s", info.project_location)
-
     -- read global interface version and check if this version of the local
     -- tools supports the version used for the project
     local givf = e2lib.join(info.root, e2lib.globals.global_interface_version_file)
@@ -1378,15 +1388,6 @@ function e2tool.collect_project_info(info, skip_load_config)
         end
     end
 
-    info.cache, re = e2lib.setup_cache()
-    if not info.cache then
-        return false, e:cat(re)
-    end
-    rc = cache.new_cache_entry(info.cache, info.root_server_name,
-        info.root_server, { writeback=true },  nil, nil )
-    rc = cache.new_cache_entry(info.cache, info.proj_storage_server_name,
-        nil, nil, info.default_repo_server, info.project_location)
-
     --e2tool.add_source_results(info)
 
     -- provide a sorted list of results