From a13b2e386d8883ac3d78380c8f3b0aae578eed43 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Tue, 30 Aug 2016 23:20:06 +0200 Subject: [PATCH] e2tool: tranport is an implementation detail of cache, stop using it Signed-off-by: Tobias Ulmer --- local/e2tool.lua | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/local/e2tool.lua b/local/e2tool.lua index 4d97518..43b9b78 100644 --- a/local/e2tool.lua +++ b/local/e2tool.lua @@ -53,7 +53,6 @@ local scm = require("scm") local source = require("source") local strict = require("strict") local tools = require("tools") -local transport = require("transport") local url = require("url") -- Build function table, see end of file for details. @@ -856,18 +855,13 @@ local function verify_remote_fileid(info, file, fileid) return false, e:cat(re) end elseif u.transport == "http" or u.transport == "https" then - local ce, re = cache.ce_by_server(info.cache, file.server) - if not ce then - return false, e:cat(re) - end - local tmpfile, re = e2lib.mktempfile() if not tmpfile then return false, e:cat(re) end - rc, re = transport.fetch_file(ce.remote_url, file.location, - e2lib.dirname(tmpfile), e2lib.basename(tmpfile)) + rc, re = cache.fetch_file(info.cache, file.server, file.location, + e2lib.dirname(tmpfile), e2lib.basename(tmpfile), { cache = false }) if not rc then return false, e:cat(re) end @@ -884,9 +878,9 @@ local function verify_remote_fileid(info, file, fileid) end if fileid ~= remote_fileid then return false, err.new( - "checksum for remote file %s:%s (%s) does not match" .. - " configured checksum (%s)", - file.server, file.location, remote_fileid, fileid) + "checksum for remote file %s:%s (%s) does not match" .. + " configured checksum (%s)", + file.server, file.location, remote_fileid, fileid) end e2lib.logf(4, "checksum for remote file %s:%s matches (%s)", file.server, file.location, fileid) -- 2.39.5