From f6c8280b298936eb9b24215b12872d2824cae62f Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Fri, 6 Dec 2013 18:53:37 +0100 Subject: [PATCH] e2tool: Remove hash_path() and use hash.hash_file_once instead Signed-off-by: Tobias Ulmer --- local/e2tool.lua | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/local/e2tool.lua b/local/e2tool.lua index 5964912..c47e5e1 100644 --- a/local/e2tool.lua +++ b/local/e2tool.lua @@ -1860,26 +1860,6 @@ function e2tool.dsort(info) return e2tool.dlist_recursive(info, info.project.default_results) end ---- hash a file --- @param path string: path to a file --- @return string the hash value, nil on error --- @return nil, an error string on error -function e2tool.hash_path(path) - assert(type(path) == "string") - assert(string.len(path) > 0) - - local e = err.new("error hashing path") - - local ctx = hash.hash_start() - - local rc, re = hash.hash_file(ctx, path) - if not rc then - return nil, e:cat(re) - end - - return hash.hash_finish(ctx) -end - --- hash a file addressed by server name and location. -- @param info info structure -- @param server the server name @@ -1897,7 +1877,7 @@ local function hash_file(info, server, location) if not path then return nil, e:cat(re) end - return e2tool.hash_path(path) + return hash.hash_file_once(path) end --- verify that a file addressed by server name and location matches the -- 2.39.5