From: Tobias Ulmer Date: Wed, 7 Sep 2016 13:40:33 +0000 (+0200) Subject: e2tool: restore fileid() behaviour and only verify when check-remote is true X-Git-Tag: e2factory-2.3.15rc1~105 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=32bbd6caf700eaa50d2e8b1c6514cd26a71cdb54;p=e2factory.git e2tool: restore fileid() behaviour and only verify when check-remote is true Signed-off-by: Tobias Ulmer --- diff --git a/local/e2tool.lua b/local/e2tool.lua index eef56b2..da75f13 100644 --- a/local/e2tool.lua +++ b/local/e2tool.lua @@ -943,7 +943,7 @@ function e2tool.fileid(info, file) assertIsStringN(file.server) assertIsStringN(file.location) - local rc, re, e, fileid, filever + local rc, re, e, fileid e = err.new("error calculating file id for file: %s:%s", file.server, file.location) @@ -957,10 +957,16 @@ function e2tool.fileid(info, file) end end - filever = { server = file.server, location = file.location, sha1 = fileid } - rc, re = e2tool.verify_hash(info, filever) - if not rc then - return false, e:cat(re) + if e2option.opts["check-remote"] then + local filever = { + server = file.server, + location = file.location, + sha1 = fileid + } + rc, re = e2tool.verify_hash(info, filever) + if not rc then + return false, e:cat(re) + end end return fileid