]> git.e2factory.org Git - e2factory.git/commitdiff
e2tool: restore fileid() behaviour and only verify when check-remote is true
authorTobias Ulmer <tu@emlix.com>
Wed, 7 Sep 2016 13:40:33 +0000 (15:40 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:18 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
local/e2tool.lua

index eef56b2b0f105604bc434b23a2292289135b561e..da75f13dc08059f8dde6efb22021f8abd4a48497 100644 (file)
@@ -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