]> git.e2factory.org Git - e2factory.git/commitdiff
cache: fetch_file() destname and flags are optional now
authorTobias Ulmer <tu@emlix.com>
Tue, 30 Aug 2016 16:07:52 +0000 (18:07 +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 26705d0024c9cf5ecd629ffe46346ffbae322152..22797ed68411fa9180b34ab3554852b69ba9e6d6 100644 (file)
@@ -303,8 +303,8 @@ end
 -- @param server the server name
 -- @param location location relative to the server url
 -- @param destdir where to store the file locally
--- @param destname filename of the fetched file
--- @param flags table of flags
+-- @param destname filename of the fetched file (optional)
+-- @param flags table of flags (optional)
 -- @return bool
 -- @return an error object on failure
 function cache.fetch_file(c, server, location, destdir, destname, flags)
@@ -317,6 +317,9 @@ function cache.fetch_file(c, server, location, destdir, destname, flags)
     if not destname then
         destname = e2lib.basename(location)
     end
+    if not flags then
+        flags = {}
+    end
     -- fetch the file
     if ce.flags.cache and flags.cache ~= false then
         -- cache is enabled: