]> git.e2factory.org Git - e2factory.git/commitdiff
e2tool: Remove hash_path() and use hash.hash_file_once instead
authorTobias Ulmer <tu@emlix.com>
Fri, 6 Dec 2013 17:53:37 +0000 (18:53 +0100)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:17 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
local/e2tool.lua

index 5964912cf7c9af9f4a98207ae2fe2114401d87be..c47e5e111649582ed0f41288d76e5bea45de99b6 100644 (file)
@@ -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