]> git.e2factory.org Git - e2factory.git/commitdiff
cache: remove unused function file_local()
authorTobias Ulmer <tu@emlix.com>
Wed, 31 Aug 2016 15:44:03 +0000 (17:44 +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>
generic/cache.lua

index 343043c444503e668aad856748efb9a3993cd941..7f6978f773c2e40b941a16edfd03b535569e771e 100644 (file)
@@ -288,40 +288,6 @@ function cache.file_in_cache(c, server, location)
     return true
 end
 
---- check if a file is available locally
--- @param c a cache table
--- @param server the server name
--- @param location location relative to the server url
--- @return bool
--- @return an error object on failure
-function cache.file_local(c, server, location)
-    local rc, re = file_in_cache(c, server, location)
-    if re then
-        return false, re
-    end
-    if rc then
-        return true
-    end
-    local ce, re = cache.ce_by_server(c, server)
-    if not ce then
-        return false, re
-    end
-    if ce.islocal == false then
-        return false
-    end
-    local path, re = cache.file_path(c, server, location)
-    if re then
-        return false, re
-    end
-    if not path then
-        return false
-    end
-    if not e2lib.isfile(path) then
-        return false
-    end
-    return true
-end
-
 --- fetch a file from a server, with caching in place
 -- @param c a cache table
 -- @param server the server name