]> git.e2factory.org Git - e2factory.git/commitdiff
cache: remove info.cache
authorTobias Ulmer <tu@emlix.com>
Mon, 23 Jan 2017 15:24:02 +0000 (16:24 +0100)
committerTobias Ulmer <tu@emlix.com>
Mon, 30 Jan 2017 13:33:34 +0000 (14:33 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
18 files changed:
generic/cache.lua
global/e2-create-project.lua
global/e2-fetch-project.lua
global/e2-install-e2.lua
local/chroot.lua
local/e2-fetch-sources.lua
local/e2-ls-project.lua
local/e2-new-source.lua
local/e2build.lua
local/e2tool.lua
local/policy.lua
local/source.lua
plugins/collect_project.lua
plugins/cvs.lua
plugins/files.lua
plugins/git.lua
plugins/gitrepo.lua
plugins/svn.lua

index e920942f190ed22814941e72b42f097b3f9d185e..1e522c73151a00740a6741d70f0b8c8f7d9cca96 100644 (file)
@@ -114,6 +114,20 @@ function cache.setup_cache(config)
     return c
 end
 
+local _cache
+--- Set or return the current cache object.
+-- @param the_cache New cache object. Optional.
+-- @return Current cache object.
+-- @raise Assertion if unset/invalid
+function cache.cache(the_cache)
+    if the_cache then
+        _cache = the_cache
+    end
+    assertIsTable(_cache)
+    assert(_cache._name == "local cache")
+    return _cache
+end
+
 --- Add local servers to the cache configuration. As the name implies,
 -- this function should not be called from a global context.
 -- @param c cache object
index 733f52dbf5d2ef38365e90d14ca566d7ed5a5db8..bc8dc7721a76101c1d00dced9fcb043a7ce851a4 100644 (file)
@@ -116,12 +116,14 @@ local function e2_create_project(arg)
         error(e:cat(re))
     end
 
-    local scache, re = cache.setup_cache(config)
-    if not scache then
+    rc, re = cache.setup_cache(config)
+    if not rc then
         error(e:cat(re))
     end
 
-    rc, re = cache.setup_cache_apply_opts(scache)
+    cache.cache(rc)
+
+    rc, re = cache.setup_cache_apply_opts(cache.cache())
     if not rc then
         error(e:cat(re))
     end
@@ -136,10 +138,10 @@ local function e2_create_project(arg)
         error(e:cat(re))
     end
 
-    if not cache.writeback_enabled(scache, sl.server) then
+    if not cache.writeback_enabled(cache.cache(), sl.server) then
         e2lib.warnf("WOTHER", "enabling writeback for server: %s",
             sl.server)
-        rc, re = cache.set_writeback(scache, sl.server, true)
+        rc, re = cache.set_writeback(cache.cache(), sl.server, true)
         if not rc then
             error(e:cat(re))
         end
@@ -185,7 +187,7 @@ local function e2_create_project(arg)
         end
 
         flocation = e2lib.join(p.location, f.filename)
-        rc, re = cache.push_file(scache, sourcefile, p.server, flocation)
+        rc, re = cache.push_file(cache.cache(), sourcefile, p.server, flocation)
         if not rc then
             error(e:cat(re))
         end
@@ -200,7 +202,7 @@ local function e2_create_project(arg)
     -- create the initial repository on server side
 
     local rlocation = string.format("%s/proj/%s.git", p.location, p.name)
-    rc, re = generic_git.git_init_db(scache, p.server, rlocation)
+    rc, re = generic_git.git_init_db(cache.cache(), p.server, rlocation)
     if not rc then
         error(e:cat(re))
     end
@@ -301,7 +303,7 @@ local function e2_create_project(arg)
 
     local refspec = "master:refs/heads/master"
     local rlocation = string.format("%s/proj/%s.git", p.location, p.name)
-    rc, re = generic_git.git_push(scache, tmp_repo_path, p.server,
+    rc, re = generic_git.git_push(cache.cache(), tmp_repo_path, p.server,
         rlocation, refspec)
     if not rc then
         error(e:cat(re))
index d5de6938b99fa1b32021f2eaad1b9feef0cd76e0..c501900cb3d539e78fbc4b35eaa3c8fbf80f3bb3 100644 (file)
@@ -55,12 +55,14 @@ local function e2_fetch_project(arg)
     end
 
     -- setup cache
-    local scache, re = cache.setup_cache(config)
-    if not scache then
+    rc, re = cache.setup_cache(config)
+    if not rc then
         error(e:cat(re))
     end
 
-    rc, re = cache.setup_cache_apply_opts(scache)
+    cache.cache(rc)
+
+    rc, re = cache.setup_cache_apply_opts(cache.cache())
     if not rc then
         error(e:cat(re))
     end
@@ -118,7 +120,7 @@ local function e2_fetch_project(arg)
     end
 
     local location = string.format("%s/version", p.location)
-    local rc, re = cache.fetch_file(scache, p.server, location, tmpdir, nil,
+    local rc, re = cache.fetch_file(cache.cache(), p.server, location, tmpdir, nil,
         { cache = false })
     if not rc then
         error(e:cat(re))
@@ -142,7 +144,7 @@ local function e2_fetch_project(arg)
     -- clone the git repository
     local location = string.format("%s/proj/%s.git", p.location, p.name)
     local skip_checkout = false
-    local rc, re = generic_git.git_clone_from_server(scache, p.server, location,
+    local rc, re = generic_git.git_clone_from_server(cache.cache(), p.server, location,
         p.destdir, skip_checkout)
     if not rc then
         error(e:cat(re))
index 7073109c5818c3e5d6b871085b41887b36c5826d..eb02d1a89f92d7b19b39ebc9373ffcde5217f35e 100644 (file)
@@ -59,12 +59,14 @@ local function e2_install_e2(arg)
         error(re)
     end
 
-    local scache, re = cache.setup_cache(config)
-    if not scache then
+    rc, re = cache.setup_cache(config)
+    if not rc then
         error(e:cat(re))
     end
 
-    rc, re = cache.setup_cache_apply_opts(scache)
+    cache.cache(rc)
+
+    rc, re = cache.setup_cache_apply_opts(cache.cache())
     if not rc then
         error(e:cat(re))
     end
@@ -130,7 +132,7 @@ local function e2_install_e2(arg)
     local location = config.site.e2_location
     local destdir = e2lib.join(root, ".e2/e2")
     e2lib.logf(2, "fetching e2factory (ref %s)", ref)
-    rc, re = generic_git.git_clone_from_server(scache, server, location,
+    rc, re = generic_git.git_clone_from_server(cache.cache(), server, location,
         destdir, false)
     if not rc then
         error(e:cat(re))
@@ -158,7 +160,7 @@ local function e2_install_e2(arg)
             end
         end
 
-        rc, re = generic_git.git_clone_from_server(scache, server, location,
+        rc, re = generic_git.git_clone_from_server(cache.cache(), server, location,
             destdir, false)
         if not rc then
             error(e:cat(re))
index 20b573a8e6b02dff6760cc4de762ee953914203b..43329dde84bb86ad3c415ad88a4a71b6146b5418 100644 (file)
@@ -220,7 +220,7 @@ function chroot.load_chroot_config(info)
             e:append(" `server' attribute missing")
             return false, e
         end
-        if not cache.valid_server(info.cache, grp.server) then
+        if not cache.valid_server(cache.cache(), grp.server) then
             e:append("in group: %s", grp.name)
             e:append(" no such server: %s", grp.server)
             return false, e
index 204e2217db6388076da4f08fe8552f0f5bb3a7bb..8f0e3b3edc37bd5769581c8e2ccdafd987be363a 100644 (file)
@@ -94,8 +94,8 @@ local function e2_fetch_source(arg)
         for _,g in ipairs(chroot.groups_sorted) do
             grp = chroot.groups_byname[g]
             for file in grp:file_iter() do
-                if cache.cache_enabled(info.cache, file:server()) then
-                    rc, re = cache.fetch_file_path(info.cache, file:server(),
+                if cache.cache_enabled(cache.cache(), file:server()) then
+                    rc, re = cache.fetch_file_path(cache.cache(), file:server(),
                         file:location())
                     if not rc then
                         return false, re
index 767689dab0590384f2a2471c806e326c488d0952..cce586a5e4bb8b4278bdc9c3992e0384300bb8a5 100644 (file)
@@ -216,9 +216,9 @@ local function e2_ls_project(arg)
     local s1 = "|"
     local s2 = "|"
     p1(s1, s2, "servers")
-    local servers_sorted = cache.servers(info.cache)
+    local servers_sorted = cache.servers(cache.cache())
     for i = 1, #servers_sorted, 1 do
-        local ce = cache.ce_by_server(info.cache, servers_sorted[i])
+        local ce = cache.ce_by_server(cache.cache(), servers_sorted[i])
         if i < #servers_sorted then
             s2 = "|"
         else
index 1caafe207696b0411aae8e54fbc83e91f142da57..68a0a6c459a68c0bfbdb9c98ce11b2d52d49e0fa 100644 (file)
@@ -260,7 +260,7 @@ local function e2_new_source(arg)
         -- local
         local lserver = cache.server_names().dot
         local llocation = string.format("in/%s/.git", name)
-        local rc, re = generic_git.new_repository(info.cache, lserver, llocation,
+        local rc, re = generic_git.new_repository(cache.cache(), lserver, llocation,
             rserver, rlocation)
         if not rc then
             error(re)
@@ -286,7 +286,7 @@ local function e2_new_source(arg)
             error(err.new("checksum file argument missing"))
         end
 
-        local rc, re = new_files_source(info.cache, server, location, source_file,
+        local rc, re = new_files_source(cache.cache(), server, location, source_file,
         checksum_file, verify)
         if not rc then
             error(re)
index edd208367ef535d34fbcb46da47094ed4027aea0..3b311aa3b948b53bea56cc13dfc972b2ce455064 100644 (file)
@@ -302,7 +302,7 @@ function e2build.build_process_class:_result_available(res, return_flags)
     local result_location = e2lib.join(location, res:get_name(),
         buildid, "result.tar")
 
-    rc, re = cache.file_exists(info.cache, server, result_location)
+    rc, re = cache.file_exists(cache.cache(), server, result_location)
     if re then
         return false, e:cat(re)
     end
@@ -437,7 +437,7 @@ function e2build.build_process_class:_setup_chroot(res, return_flags)
                 return false, e:cat(re)
             end
 
-            path, re = cache.fetch_file_path(info.cache, file:server(), file:location())
+            path, re = cache.fetch_file_path(cache.cache(), file:server(), file:location())
             if not path then
                 return false, e:cat(re)
             end
@@ -483,7 +483,7 @@ function e2build.build_process_class:_install_build_script(res, return_flags)
     destdir = e2lib.join(bc.T, "script")
     info = e2tool.info()
 
-    rc, re = cache.fetch_file(info.cache, cache.server_names().dot,
+    rc, re = cache.fetch_file(cache.cache(), cache.server_names().dot,
         location, destdir)
     if not rc then
         e = err.new("installing build script")
@@ -534,7 +534,7 @@ function e2build.build_process_class:_install_init_files(res, return_flags)
                 abslocation)
             end
 
-            rc, re = cache.fetch_file(info.cache,
+            rc, re = cache.fetch_file(cache.cache(),
                 cache.server_names().dot, location, destdir)
             if not rc then
                 return false, e:cat(re)
@@ -624,7 +624,7 @@ function e2build.build_process_class:helper_unpack_result(res, dep, destdir)
         dep:get_name(), server, location)
 
     resulttarpath = e2lib.join(location, dep:get_name(), buildid, "result.tar")
-    path, re = cache.fetch_file_path(info.cache, server, resulttarpath)
+    path, re = cache.fetch_file_path(cache.cache(), server, resulttarpath)
     if not path then
         return false, e:cat(re)
     end
@@ -876,7 +876,7 @@ function e2build.build_process_class:helper_deploy(res, tmpdir)
     local cache_flags = {
         cache = false,
     }
-    local rc, re = cache.fetch_file(info.cache, server, location1, tmpdir,
+    local rc, re = cache.fetch_file(cache.cache(), server, location1, tmpdir,
         nil, cache_flags)
     if rc then
         e2lib.warnf("WOTHER",
@@ -893,13 +893,13 @@ function e2build.build_process_class:helper_deploy(res, tmpdir)
 
         sourcefile = e2lib.join(resdir, f)
         location1 = e2lib.join(location, res:get_name(), f)
-        rc, re = cache.push_file(info.cache, sourcefile, server, location1,
+        rc, re = cache.push_file(cache.cache(), sourcefile, server, location1,
             cache_flags)
         if not rc then
             return false, re
         end
     end
-    if cache.writeback_enabled(info.cache, server, cache_flags) == false then
+    if cache.writeback_enabled(cache.cache(), server, cache_flags) == false then
         e2lib.warnf("WOTHER",
             "Writeback is disabled for server %q. Release not deployed!", server)
     end
@@ -1034,7 +1034,7 @@ function e2build.build_process_class:_store_result(res, return_flags)
     local cache_flags = {
         try_hardlink = true,
     }
-    rc, re = cache.push_file(info.cache, sourcefile, server,
+    rc, re = cache.push_file(cache.cache(), sourcefile, server,
         location1, cache_flags)
     if not rc then
         return false, e:cat(re)
@@ -1067,8 +1067,8 @@ function e2build.build_process_class:_linklast(res, return_flags)
     location = e2lib.join(location, res:get_name(), buildid, "result.tar")
 
     -- if we don't have cache or server on local fs, fetch a copy into "out"
-    if not cache.cache_enabled(info.cache, server) and not
-        cache.islocal_enabled(info.cache, server) then
+    if not cache.cache_enabled(cache.cache(), server) and not
+        cache.islocal_enabled(cache.cache(), server) then
         e2lib.logf(3, "%s: copy to out/%s/last, server %q has no cache/not local",
             res:get_name(), res:get_name(), server)
 
@@ -1081,14 +1081,14 @@ function e2build.build_process_class:_linklast(res, return_flags)
             return e:cat(re)
         end
 
-        rc, re = cache.fetch_file(info.cache, server, location, lnk, nil)
+        rc, re = cache.fetch_file(cache.cache(), server, location, lnk, nil)
         if not rc then
             return false, e:cat(re)
         end
 
         return true
     else -- otherwise create a symlink
-        dst, re = cache.fetch_file_path(info.cache, server, location)
+        dst, re = cache.fetch_file_path(cache.cache(), server, location)
         if not dst then
             return false, e:cat(re)
         end
index 4466c6433d69252dc747b05d6e3b5b72d57cb72e..5ee04e0f52a22430a4b8038f15f99779c46672a3 100644 (file)
@@ -143,7 +143,7 @@ function e2tool.file_class:validate_set_servloc(server, location)
 
     info = e2tool.info()
 
-    if not cache.valid_server(info.cache, server) then
+    if not cache.valid_server(cache.cache(), server) then
         return false, err.new("file entry with unknown server: %s", server)
     end
 
@@ -244,7 +244,7 @@ function e2tool.file_class:_compute_checksum(digest_type, flags)
 
     info = e2tool.info()
 
-    path, re = cache.fetch_file_path(info.cache, self._server, self._location,
+    path, re = cache.fetch_file_path(cache.cache(), self._server, self._location,
         flags)
     if not path then
         return false, re
@@ -276,7 +276,7 @@ function e2tool.file_class:_compute_remote_checksum(digest_type)
 
     info = e2tool.info()
 
-    surl, re = cache.remote_url(info.cache, self._server, self._location)
+    surl, re = cache.remote_url(cache.cache(), self._server, self._location)
     if not surl then
         return false, re
     end
@@ -432,7 +432,7 @@ function e2tool.file_class:checksum_verify()
 
     for _,digest_type in ipairs(digest_types) do
 
-        if cache.cache_enabled(info.cache, self._server) then
+        if cache.cache_enabled(cache.cache(), self._server) then
             cs_cache, re = self:_compute_checksum(digest_type)
             if not cs_cache then
                 return false, e:cat(re)
@@ -1017,17 +1017,19 @@ function e2tool.collect_project_info(info, skip_load_config)
         return false, e:cat(re)
     end
 
-    info.cache, re = cache.setup_cache(config)
-    if not info.cache then
+    rc, re = cache.setup_cache(config)
+    if not rc then
         return false, e:cat(re)
     end
 
-    rc, re = cache.setup_cache_local(info.cache, e2tool.root(), info.project_location)
+    cache.cache(rc)
+
+    rc, re = cache.setup_cache_local(cache.cache(), e2tool.root(), info.project_location)
     if not rc then
         return false, e:cat(re)
     end
 
-    rc, re = cache.setup_cache_apply_opts(info.cache)
+    rc, re = cache.setup_cache_apply_opts(cache.cache())
     if not rc then
         return false, e:cat(re)
     end
index 725e87f3630a6eb7e9dcb5442e6cce4d93ff1d73..186e5068336564b72d54df82199f8464892df624 100644 (file)
@@ -167,16 +167,16 @@ function policy.init(info)
         local release_id = "release-id"
         local server, location = s(location, release_id)
         local se = err.new("checking server configuration for '%s'", server)
-        local ce, re = cache.ce_by_server(info.cache, server)
+        local ce, re = cache.ce_by_server(cache.cache(), server)
         if not ce then
             se:cat(re)
-        elseif not cache.writeback_enabled(info.cache, server) then
+        elseif not cache.writeback_enabled(cache.cache(), server) then
             e2lib.warnf("WPOLICY",
             "Results will not be pushed to server: '%s'"..
             " (Writeback disabled)", server)
         end
-        if ce and not (cache.writeback_enabled(info.cache, server)
-            or cache.cache_enabled(info.cache, server)) then
+        if ce and not (cache.writeback_enabled(cache.cache(), server)
+            or cache.cache_enabled(cache.cache(), server)) then
             se:append(
             "Cannot store results. "..
             "Enable cache or writeback.")
index 849c2a3f823dea40bfcc79e9aa4fed1a77bf7fc3..cb801358c27e496be6e1ba94d4678517b8134411 100644 (file)
@@ -448,7 +448,7 @@ function source.generic_source_validate_server(rawsrc, ismandatory)
         return false, err.new("'server' attribute must be a string")
     end
 
-    if rawsrc.server and (not cache.valid_server(info.cache, rawsrc.server)) then
+    if rawsrc.server and (not cache.valid_server(cache.cache(), rawsrc.server)) then
         return false, err.new("invalid server: %s", rawsrc.server)
     end
 
index 82d0b9073bc75fec53b7b2f11b71406c61a65e94..1d3f834703be2d1a26ed3c08dd2669934051eb2c 100644 (file)
@@ -158,7 +158,7 @@ local function _build_collect_project(self, res, return_flags)
         local server = cache.server_names().dot
         local location = e2lib.join("proj/init", f)
         local cache_flags = {}
-        rc, re = cache.fetch_file(info.cache, server, location,
+        rc, re = cache.fetch_file(cache.cache(), server, location,
             destdir, nil, cache_flags)
         if not rc then
             return false, e:cat(re)
@@ -196,7 +196,7 @@ local function _build_collect_project(self, res, return_flags)
 
         for file in grp:file_iter() do
             local cache_flags = {}
-            rc, re = cache.fetch_file(info.cache, file:server(),
+            rc, re = cache.fetch_file(cache.cache(), file:server(),
                 file:location(), destdir, nil, cache_flags)
             if not rc then
                 return false, e:cat(re)
@@ -247,7 +247,7 @@ local function _build_collect_project(self, res, return_flags)
             if not rc then
                 return false, e:cat(re)
             end
-            rc, re = cache.fetch_file(info.cache, file:server(), file:location(),
+            rc, re = cache.fetch_file(cache.cache(), file:server(), file:location(),
                 destdir, nil, cache_flags)
             if not rc then
                 return false, e:cat(re)
@@ -275,7 +275,7 @@ local function _build_collect_project(self, res, return_flags)
         for _,file in pairs(files) do
             local server = cache.server_names().dot
             local cache_flags = {}
-            rc, re = cache.fetch_file(info.cache, server, file, destdir,
+            rc, re = cache.fetch_file(cache.cache(), server, file, destdir,
                 nil, cache_flags)
             if not rc then
                 return false, e:cat(re)
@@ -356,7 +356,7 @@ local function _build_collect_project(self, res, return_flags)
         ".e2/lib/make/detect_tool",
     }
     for _,location in ipairs(locations) do
-        rc, re = cache.fetch_file(info.cache, server, location,
+        rc, re = cache.fetch_file(cache.cache(), server, location,
             destdir, nil, cache_flags)
         if not rc then
             return false, e:cat(re)
index a7c98b55968d4104d27e5bc6dafd69b97fcdfeb1..037e99ab9bf5463f445618c844d57755834f7d51 100644 (file)
@@ -305,7 +305,7 @@ local function mkcvsroot(info, sourcename)
 
     src = source.sources[sourcename]
 
-    surl, re = cache.remote_url(info.cache, src:get_server(), src:get_cvsroot())
+    surl, re = cache.remote_url(cache.cache(), src:get_server(), src:get_cvsroot())
     if not surl then
         return false, e:cat(re)
     end
index 4334a38eb0c9caf518db7375f273c96410a95538..98c67d3ee0d78ec05e0bbcc409d76425a963a16f 100644 (file)
@@ -309,9 +309,9 @@ function files.fetch_source(info, sourcename)
     local e = err.new("fetching source failed: %s", sourcename)
 
     for file in src:file_iter() do
-        if cache.cache_enabled(info.cache, file:server()) then
+        if cache.cache_enabled(cache.cache(), file:server()) then
             e2lib.logf(3, "files.fetch_source: caching file %s", file:servloc())
-            rc, re = cache.fetch_file_path(info.cache, file:server(), file:location())
+            rc, re = cache.fetch_file_path(cache.cache(), file:server(), file:location())
             if not rc then
                 return false, e:cat(re)
             end
@@ -487,7 +487,7 @@ function files.prepare_source(info, sourcename, sourceset, buildpath)
             return false, e:cat(re)
         end
         if file:unpack() then
-            local path, re = cache.fetch_file_path(info.cache,
+            local path, re = cache.fetch_file_path(cache.cache(),
                 file:server(), file:location())
             if not path then
                 return false, e:cat(re)
@@ -531,7 +531,7 @@ function files.prepare_source(info, sourcename, sourceset, buildpath)
                 end
             end
             if file:patch() then
-                local path, re = cache.fetch_file_path(info.cache,
+                local path, re = cache.fetch_file_path(cache.cache(),
                     file:server(), file:location())
                 if not path then
                     return false, e:append(re)
@@ -553,7 +553,7 @@ function files.prepare_source(info, sourcename, sourceset, buildpath)
                     return false, e:cat(re)
                 end
 
-                local rc, re = cache.fetch_file(info.cache, file:server(),
+                local rc, re = cache.fetch_file(cache.cache(), file:server(),
                     file:location(), destdir, destname, {})
                 if not rc then
                     return false, e:cat(re)
@@ -605,7 +605,7 @@ function files.toresult(info, sourcename, sourceset, directory)
                 sourcename, destname)
         end
 
-        rc, re = cache.fetch_file(info.cache, file:server(), file:location(),
+        rc, re = cache.fetch_file(cache.cache(), file:server(), file:location(),
             destdir, destname, {})
         if not rc then
             return false, e:cat(re)
index 5ddac52a6b355d82034c96ddc2384aef8b0af195..44c51d676063c0d1499f093a00361fe4e8dfaf22 100644 (file)
@@ -30,10 +30,10 @@ local generic_git = require("generic_git")
 local hash = require("hash")
 local licence = require("licence")
 local scm = require("scm")
+local source = require("source")
 local strict = require("strict")
 local tools = require("tools")
 local url = require("url")
-local source = require("source")
 
 --- Initialize git plugin.
 -- @param ctx Plugin context. See plugin module.
@@ -348,7 +348,7 @@ function git.git_source:check_workingcopy()
 
     -- git config remote.origin.url == server:location
     query = string.format("remote.origin.url")
-    expect, re = git_url(e2tool.info().cache, self._server, self._location)
+    expect, re = git_url(cache.cache(), self._server, self._location)
     if not expect then
         return false, e:cat(re)
     end
@@ -532,7 +532,7 @@ function git.fetch_source(info, sourcename)
     e2lib.logf(2, "cloning %s:%s [%s]", src:get_server(), src:get_location(),
         src:get_branch())
 
-    rc, re = generic_git.git_clone_from_server(info.cache, src:get_server(),
+    rc, re = generic_git.git_clone_from_server(cache.cache(), src:get_server(),
         src:get_location(), work_tree, false --[[always checkout]])
     if not rc then
         return false, e:cat(re)
index 22b98e9f33226a8bf9d3e8c5eefada70ccef2b7a..21af90b3ed505dd1b278033713c714519a33e90c 100644 (file)
@@ -291,7 +291,7 @@ function gitrepo_source:check_workingcopy()
 
     -- git config remote.origin.url == server:location
     query = string.format("remote.origin.url")
-    expect, re = git_url(e2tool.info().cache, self._server, self._location)
+    expect, re = git_url(cache.cache(), self._server, self._location)
     if not expect then
         return false, e:cat(re)
     end
@@ -345,7 +345,7 @@ function gitrepo.fetch_source(info, sourcename)
     e2lib.logf(2, "cloning %s:%s [%s]", src:get_server(), src:get_location(),
         src:get_branch())
 
-    rc, re = generic_git.git_clone_from_server(info.cache, src:get_server(),
+    rc, re = generic_git.git_clone_from_server(cache.cache(), src:get_server(),
         src:get_location(), work_tree, false --[[always checkout]])
     if not rc then
         return false, e:cat(re)
index 85fd09693a81540a6576a4dc8ac7db7492f7b7b6..c616eb56759566ab5ee42a21dcb9bf009ee779e8 100644 (file)
@@ -296,7 +296,7 @@ function svn.svn_source:sourceid(sourceset)
     info = e2tool.info()
     assert(type(info) == "table")
 
-    surl, re = cache.remote_url(info.cache, self._server, self._location)
+    surl, re = cache.remote_url(cache.cache(), self._server, self._location)
     if not surl then
         return false, re
     end
@@ -408,7 +408,7 @@ function svn.fetch_source(info, sourcename)
     local src = source.sources[sourcename]
     local location = src:get_location()
     local server = src:get_server()
-    local surl, re = cache.remote_url(info.cache, server, location)
+    local surl, re = cache.remote_url(cache.cache(), server, location)
     if not surl then
         return false, e:cat(re)
     end
@@ -436,7 +436,7 @@ function svn.prepare_source(info, sourcename, sourceset, build_path)
     local src = source.sources[sourcename]
     local location = src:get_location()
     local server = src:get_server()
-    local surl, re = cache.remote_url(info.cache, server, location)
+    local surl, re = cache.remote_url(cache.cache(), server, location)
     if not surl then
         return false, e:cat(re)
     end