From 9d23287ca21be009878ec900e5ff56ab4728e6fe Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Thu, 1 Dec 2016 20:28:24 +0100 Subject: [PATCH] file_class: replace hash_file_once with digest to compute checksum Signed-off-by: Tobias Ulmer --- local/e2tool.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/local/e2tool.lua b/local/e2tool.lua index 7bf7b8b..f932c4d 100644 --- a/local/e2tool.lua +++ b/local/e2tool.lua @@ -122,7 +122,7 @@ end -- @return SHA1 checksum on success, false if an error occured. -- @return error object on failure. function e2tool.file_class:_compute_checksum(flags) - local rc, re, info, path, checksum + local rc, re, info, path, dt info = e2tool.info() @@ -132,12 +132,14 @@ function e2tool.file_class:_compute_checksum(flags) return false, re end - checksum, re = hash.hash_file_once(path) - if not checksum then + dt = digest.new() + digest.new_entry(dt, digest.SHA1, nil--[[checksum]], nil--[[name]], path) + rc, re = digest.checksum(dt, false) + if not rc then return false, re end - return checksum + return dt[1].checksum end --- Compute checksum of file on the remote server, if transport supports it. -- 2.39.5