From 0c9b6eb7ccd12be14c8d0f54782ef11ecf0e5cae Mon Sep 17 00:00:00 2001 From: V1K1NGbg Date: Sun, 14 Jul 2024 17:35:28 +0300 Subject: fix for manifest --- src/luarocks/core/manif.tl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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 -- Table with repository identifiers as keys and tables mapping -- Lua versions to cached loaded manifests as values. -local manifest_cache: Manifest = {} +local manifest_cache: {string: {string: Manifest}} = {} --- Cache a loaded manifest. -- @param repo_url string: The repository identifier. @@ -49,8 +49,8 @@ local manifest_cache: Manifest = {} -- @param manifest table: the manifest to be cached. function manif.cache_manifest(repo_url: string, lua_version: string, manifest: Manifest) lua_version = lua_version or cfg.lua_version - manifest_cache.repository[repo_url] = manifest_cache.repository[repo_url] or {} - manifest_cache.repository[repo_url][lua_version] = manifest + manifest_cache[repo_url] = manifest_cache[repo_url] or {} + manifest_cache[repo_url][lua_version] = manifest end --- Attempt to get cached loaded manifest. @@ -59,7 +59,7 @@ end -- @return table or nil: loaded manifest or nil if cache is empty. function manif.get_cached_manifest(repo_url: string, lua_version: string): Manifest lua_version = lua_version or cfg.lua_version - return manifest_cache.repository[repo_url] and manifest_cache.repository[repo_url][lua_version] + return manifest_cache[repo_url] and manifest_cache[repo_url][lua_version] end --- Back-end function that actually loads the manifest -- cgit v1.2.3-55-g6feb