]> git.e2factory.org Git - e2factory.git/commit
cache: rework the caching strategy
authorTobias Ulmer <tu@emlix.com>
Fri, 2 Sep 2016 11:10:58 +0000 (13:10 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:18 +0000 (15:41 +0100)
commit636f41579770bb5dd8d51575fa12911f4f952f8f
treebaa8586f5dae9e72ac97985cc134450b5d5d6ec6
parentd3dff2b1d5142af1605e79715013b6c84a10f2f1
cache: rework the caching strategy

Introduce new functions to fetch and push files in a consistent way.

To query server flags we now have:

- cache.cache_enabled()
- cache.islocal_enabled()
- cache.writeback_enabled()

All take the optional flags argument, allowing for overrides when
necessary.

The flags table is now checked for unknown flags, throwing a runtime
error. Unused flags have been removed.

Removed the function to cache files explicitly, return the file path if
in cache, and removed some dead code.
If the cache is enabled, calls to any function requesting path or a
copy of the requested file will cache automatically. This behaviour can
now be suppressed with the flags argument.

Introduced a function to check for the existence of a file on the remote
side without downloading:
transport.file_exists()

Added new function
- cache.fetch_file_path()
that returns the requested files path to either the cache, local
file system or a temporary location.

The code base was adjusted to work without any caching if desired,
although this is not a recommended mode of operation due to speed and
temporary storage requirements.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/cache.lua
generic/transport.lua
local/e2-fetch-sources.lua
local/e2build.lua
local/e2tool.lua
local/policy.lua
plugins/files.lua