local src = info.sources[ sourcename ]
local location = src.cvsroot
local server = src.server
- local surl, re = cache.remote_url(info.cache, server, location)
+ local surl, re = info.cache:remote_url(server, location)
if not surl then
return false, e:cat(re)
end
local src = info.sources[ sourcename ]
local location = src.cvsroot
local server = src.server
- local surl, re = cache.remote_url(info.cache, server, location)
+ local surl, re = info.cache:remote_url(server, location)
if not surl then
return false, e:cat(re)
end
local result_location = string.format("%s/%s/%s/result.tar", location, r,
dep_set)
local cache_flags = {}
- rc, re = cache.cache_file(info.cache, server, result_location, cache_flags)
+ rc, re = info.cache:cache_file(server, result_location, cache_flags)
if not rc then
e2lib.log(3, "caching result failed")
-- ignore
end
local cache_flags = {}
- local path, re = cache.file_path(info.cache, server, result_location,
- cache_flags)
+ local path, re = info.cache:file_path(server, result_location, cache_flags)
rc = e2lib.isfile(path)
if not rc then
-- result is not available. Build.
if res.build_config.groups[grp.name] then
for _, f in ipairs(grp.files) do
local flags = { cache = true }
- local rc, re = cache.cache_file(info.cache, f.server, f.location,
- flags)
+ local rc, re = info.cache:cache_file(f.server, f.location, flags)
if not rc then
return false, e:cat(re)
end
- local path, re = cache.file_path(info.cache, f.server, f.location,
- flags)
+ local path, re = info.cache:file_path(f.server, f.location, flags)
if not path then
return false, e:cat(re)
end
local location1 = string.format("%s/%s/%s/result.tar", location, dep,
dep_set)
local cache_flags = {}
- local rc, re = cache.fetch_file(info.cache, server, location1, tmpdir,
+ local rc, re = info.cache:fetch_file(server, location1, tmpdir,
nil, cache_flags)
if not rc then
return false, e:cat(re)
local cache_flags = {
check_only = true
}
- local dst, re = cache.file_path(info.cache, server, location1, cache_flags)
+ local dst, re = info.cache:file_path(server, location1, cache_flags)
if not dst then
return false, e:cat(re)
end
-- create the last link
local lnk_location = string.format("out/%s/last", r)
- local lnk, re = cache.file_path(info.cache, info.root_server_name,
- lnk_location)
+ local lnk, re = info.cache:file_path(info.root_server_name, lnk_location)
if not lnk then
return false, e:cat(re)
end
local cache_flags = {
try_hardlink = true,
}
- local rc, re = cache.push_file(info.cache, sourcefile, server, location1,
+ local rc, re = info.cache:push_file(sourcefile, server, location1,
cache_flags)
if not rc then
return false, e:cat(re)
local server = "."
local location = string.format("proj/init/%s", f)
local cache_flags = {}
- rc, re = cache.fetch_file(info.cache, server, location,
+ rc, re = info.cache:fetch_file(server, location,
destdir, nil, cache_flags)
if not rc then
return false, e:cat(re)
makefile:write(string.format("place:\n"))
for _,file in pairs(grp.files) do
local cache_flags = {}
- rc, re = cache.fetch_file(info.cache, file.server,
+ rc, re = info.cache:fetch_file(file.server,
file.location, destdir, nil, cache_flags)
if not rc then
return false, e:cat(re)
return false, e:cat(re)
end
end
- rc, re = cache.fetch_file(info.cache, file.server,
+ rc, re = info.cache:fetch_file(file.server,
file.location, destdir, nil,
cache_flags)
if not rc then
for _,file in pairs(files) do
local server = info.root_server_name
local cache_flags = {}
- rc, re = cache.fetch_file(info.cache, server, file,
+ rc, re = info.cache:fetch_file(server, file,
destdir, nil, cache_flags)
if not rc then
return false, e:cat(re)
".e2/lib/make/detect_tool",
}
for _,location in ipairs(locations) do
- rc, re = cache.fetch_file(info.cache, server, location,
+ rc, re = info.cache:fetch_file(server, location,
destdir, nil, cache_flags)
if not rc then
return false, e:cat(re)
local e = new_error("error reading hash file")
local cs = nil
local cache_flags = { cache = true }
- local rc, re = cache.cache_file(info.cache, server, location, cache_flags)
+ local rc, re = info.cache:cache_file(server, location, cache_flags)
if not rc then
return nil, e:cat(re)
end
- local path = cache.file_path(info.cache, server, location, cache_flags)
+ local path = info.cache:file_path(server, location, cache_flags)
if path then
cs = e2lib.read_line(path)
if cs then
function e2tool.hash_file(info, server, location)
local e = new_error("error hashing file")
local cache_flags = { cache = true }
- local rc, re = cache.cache_file(info.cache, server, location, cache_flags)
+ local rc, re = info.cache:cache_file(server, location, cache_flags)
if not rc then
return nil, e:cat(re)
end
- local path, re = cache.file_path(info.cache, server, location, cache_flags)
+ local path, re = info.cache:file_path(server, location, cache_flags)
if not path then
return nil, e:cat(re)
end
function e2tool.hashcache(info, file)
local e = new_error("getting fileid from hash cache")
local rc, re, fileid
- local p, re = cache.file_path(info.cache, file.server,
- file.location, {})
+ local p, re = info.cache:file_path(file.server, file.location, {})
if not p then
return e:cat(re)
end
local rc, re
local e = new_error("error calculating remote file id for file %s:%s",
file.server, file.location)
- if not cache.cache_enabled(info.cache, file.server) or
+ if not info.cache:cache_enabled(file.server) or
not e2option.opts["check-remote"] then
e2lib.logf(4, "checksum for remote file %s:%s skip verifying",
file.server, file.location)
return true, nil
end
- local surl, re = cache.remote_url(info.cache, file.server,
- file.location)
+ local surl, re = info.cache:remote_url(file.server, file.location)
if not surl then
return false, e:cat(re)
end
function cache_chroot(info)
for _,c in ipairs(info.chroot) do
for _,file in ipairs(c.files) do
- local rc, e = cache.cache_file(info.cache, c.server, file, {})
+ local rc, e = info.cache:cache_file(c.server, file, {})
if not rc then
return false, "caching file failed"
end
f.server, f.location))
local flags = { cache = true }
if f.server ~= info.root_server_name then
- local rc, e = cache.cache_file(info.cache, f.server, f.location, flags)
+ local rc, e = info.cache:cache_file(f.server, f.location, flags)
if not rc then
return false, e
end
end
if file.unpack then
local cache_flags = { cache = true }
- local rc, re = cache.cache_file(info.cache, file.server, file.location,
+ local rc, re = info.cache:cache_file(file.server, file.location,
cache_flags)
if not rc then
return false, e:cat(re)
end
- local path, re = cache.file_path(info.cache, file.server, file.location,
+ local path, re = info.cache:file_path(file.server, file.location,
cache_flags)
if not path then
return false, e:cat(re)
end
if file.patch then
local cache_flags = { cache = true }
- local rc, re = cache.cache_file(info.cache, file.server, file.location,
+ local rc, re = info.cache:cache_file(file.server, file.location,
cache_flags)
if not rc then
return false, e:cat(re)
end
- local path, re = cache.file_path(info.cache, file.server,
+ local path, re = info.cache:file_path(file.server,
file.location, cache_flags)
if not path then
return false, e:append(re)
"can't create destination directory: %s", destdir))
end
end
- local rc, re = cache.fetch_file(info.cache, file.server, file.location,
+ local rc, re = info.cache:fetch_file(file.server, file.location,
destdir, destname, {})
if not rc then
return false, e:cat(re)
local destdir = string.format("%s/%s", directory, source)
local destname = nil
e2lib.mkdir(destdir, "-p")
- local rc, re = cache.fetch_file(info.cache, file.server,
+ local rc, re = info.cache:fetch_file(file.server,
file.location, destdir, destname, {})
if not rc then
return false, e:cat(re)
local server, location = s(location, release_id)
local se = new_error("checking server configuration for '%s'",
server)
- local ce, re = cache.ce_by_server(info.cache, server)
+ local ce, re = info.cache:ce_by_server(server)
if not ce then
se:cat(re)
elseif not ce.flags.writeback then
local src = info.sources[ sourcename ]
local location = src.location
local server = src.server
- local surl, re = cache.remote_url(info.cache, server, location)
+ local surl, re = info.cache:remote_url(server, location)
if not surl then
return false, e:cat(re)
end
local src = info.sources[ sourcename ]
local location = src.location
local server = src.server
- local surl, re = cache.remote_url(info.cache, server, location)
+ local surl, re = info.cache:remote_url(server, location)
if not surl then
return false, e:cat(re)
end