aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV1K1NGbg <victor@ilchev.com>2024-07-14 17:35:28 +0300
committerV1K1NGbg <victor@ilchev.com>2024-08-05 20:49:17 +0300
commit0c9b6eb7ccd12be14c8d0f54782ef11ecf0e5cae (patch)
treec20272c4ef16c2ea45e1bd821c4f5e3ea83e3d7b
parentfdf700420bc30d98ba0070c539bde97fdbfd6344 (diff)
downloadluarocks-0c9b6eb7ccd12be14c8d0f54782ef11ecf0e5cae.tar.gz
luarocks-0c9b6eb7ccd12be14c8d0f54782ef11ecf0e5cae.tar.bz2
luarocks-0c9b6eb7ccd12be14c8d0f54782ef11ecf0e5cae.zip
fix for manifest
-rw-r--r--src/luarocks/core/manif.tl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/luarocks/core/manif.tl b/src/luarocks/core/manif.tl
index a1c84995..a089b5d8 100644
--- a/src/luarocks/core/manif.tl
+++ b/src/luarocks/core/manif.tl
@@ -41,7 +41,7 @@ local type Tree_manifest = manif.Tree_manifest
41 41
42-- Table with repository identifiers as keys and tables mapping 42-- Table with repository identifiers as keys and tables mapping
43-- Lua versions to cached loaded manifests as values. 43-- Lua versions to cached loaded manifests as values.
44local manifest_cache: Manifest = {} 44local manifest_cache: {string: {string: Manifest}} = {}
45 45
46--- Cache a loaded manifest. 46--- Cache a loaded manifest.
47-- @param repo_url string: The repository identifier. 47-- @param repo_url string: The repository identifier.
@@ -49,8 +49,8 @@ local manifest_cache: Manifest = {}
49-- @param manifest table: the manifest to be cached. 49-- @param manifest table: the manifest to be cached.
50function manif.cache_manifest(repo_url: string, lua_version: string, manifest: Manifest) 50function manif.cache_manifest(repo_url: string, lua_version: string, manifest: Manifest)
51 lua_version = lua_version or cfg.lua_version 51 lua_version = lua_version or cfg.lua_version
52 manifest_cache.repository[repo_url] = manifest_cache.repository[repo_url] or {} 52 manifest_cache[repo_url] = manifest_cache[repo_url] or {}
53 manifest_cache.repository[repo_url][lua_version] = manifest 53 manifest_cache[repo_url][lua_version] = manifest
54end 54end
55 55
56--- Attempt to get cached loaded manifest. 56--- Attempt to get cached loaded manifest.
@@ -59,7 +59,7 @@ end
59-- @return table or nil: loaded manifest or nil if cache is empty. 59-- @return table or nil: loaded manifest or nil if cache is empty.
60function manif.get_cached_manifest(repo_url: string, lua_version: string): Manifest 60function manif.get_cached_manifest(repo_url: string, lua_version: string): Manifest
61 lua_version = lua_version or cfg.lua_version 61 lua_version = lua_version or cfg.lua_version
62 return manifest_cache.repository[repo_url] and manifest_cache.repository[repo_url][lua_version] 62 return manifest_cache[repo_url] and manifest_cache[repo_url][lua_version]
63end 63end
64 64
65--- Back-end function that actually loads the manifest 65--- Back-end function that actually loads the manifest