]> git.e2factory.org Git - e2factory.git/commitdiff
cache: allow disabling the cache on-the-fly for fetch_file() and push_file() by passi...
authorGordon Hecker <gh@emlix.com>
Fri, 15 Jan 2010 16:06:50 +0000 (17:06 +0100)
committerGordon Hecker <gh@emlix.com>
Fri, 12 Feb 2010 09:51:58 +0000 (10:51 +0100)
Signed-off-by: Gordon Hecker <gh@emlix.com>
generic/cache.lua

index d5a28d4a467c0328c1ced046f5941c3714e1d597..52fac51d1c9eed3b53c55199b39a93f6ba63b7d3 100644 (file)
@@ -307,7 +307,7 @@ function fetch_file(cache, server, location, destdir, destname, flags)
                destname = e2lib.basename(location)
        end
        -- fetch the file
-       if ce.flags.cache then
+       if ce.flags.cache and flags.cache ~= false then
                -- cache is enabled:
                -- fetch from source to cache and from cache to destination
                rc, re = cache_file(cache, server, location, flags)
@@ -355,7 +355,7 @@ function push_file(cache, sourcefile, server, location, flags)
        if not ce then
                return false, e:cat(re)
        end
-       if ce.flags.cache then
+       if ce.flags.cache and flags.cache ~= false then
                -- cache is enabled:
                -- push the file from source to cache and from cache to
                -- destination