From 6d2474c94f2efe91f4d2c27cbfcebca7d6789bc7 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Tue, 30 Aug 2016 18:07:52 +0200 Subject: [PATCH] cache: fetch_file() destname and flags are optional now Signed-off-by: Tobias Ulmer --- generic/cache.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/generic/cache.lua b/generic/cache.lua index 26705d0..22797ed 100644 --- a/generic/cache.lua +++ b/generic/cache.lua @@ -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: -- 2.39.5