]> git.e2factory.org Git - e2factory.git/commitdiff
cache: remove now unused check_only flag, add error checking
authorTobias Ulmer <tu@emlix.com>
Wed, 31 Aug 2016 07:54:05 +0000 (09:54 +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 665bca06b4b8e58cab268a5c573f3e371e386a20..99648d529278096b2d17459957a8b4798e744fea 100644 (file)
@@ -55,7 +55,6 @@ local url = require("url")
 -- @class table
 -- @name flags
 -- @field cachable treat a server as cachable?
--- @field check_only check if a file is in the cache, without fetching
 
 --- Create a new cache.
 -- @param name Cache name.
@@ -90,7 +89,6 @@ local function assertFlags(flags)
     local known = {
         cachable = "boolean",
         cache = "boolean",
-        check_only = "boolean",
         islocal = "boolean",
         push_permissions = "string",
         try_hardlink = "boolean",
@@ -500,9 +498,8 @@ function cache.cache_file(c, server, location, flags)
         return false, e:cat(re)
     end
     local avail, re = cache.file_in_cache(c, server, location)
-    if avail and flags.check_only then
-        -- file is in the cache and just checking was requested
-        return true
+    if re then
+        return false, e:cat(re)
     end
     if not avail then
         local destdir = e2lib.join("/", ceurl.path, e2lib.dirname(location))