local class = require("class")
local digest -- initialized later
local e2lib = require("e2lib")
-local e2option = require("e2option")
local e2tool = require("e2tool")
local eio = require("eio")
+local policy = require("policy")
--- Checksum cache class.
self._csdict = {}
- if e2option.opts["build-mode"] == "release" then
+ if policy.opts.build_mode() == "release" then
return
end
local digest = require("digest")
local e2build = require("e2build")
local e2lib = require("e2lib")
-local e2option = require("e2option")
local eio = require("eio")
local environment = require("environment")
local err = require("err")
assert(cs_done, "no checksum algorithm enabled for fileid()")
- if e2option.opts["check-remote"] then
+ if policy.opts.check_remote() then
rc, re = self:checksum_verify()
if not rc then
return false, e:cat(re)
end
-- Server-side checksum computation for ssh-like transports
- if e2option.opts["check-remote"] then
+ if policy.opts.check_remote() then
cs_remote, re = self:_compute_remote_checksum(digest_type)
if re then
return false, e:cat(re)
end
end
- if not cs_cache or (e2option.opts["check-remote"] and not cs_remote) then
+ if not cs_cache or (policy.opts.check_remote() and not cs_remote) then
cs_fetch, re = self:_compute_checksum(digest_type, { cache = false })
if not cs_fetch then
return false, e:cat(re)
return false, e:cat(re)
end
- if e2option.opts["check"] then
+ if policy.opts.check() then
rc, re = self:check_local()
if not rc then
return false, e:cat(re)
end
end
- if e2option.opts["check-remote"] then
+ if policy.opts.check_remote() then
rc, re = self:check_remote()
if not rc then
return false, e:cat(re)