From 0555546ceeebe47899bf755b01f459eff0cebe08 Mon Sep 17 00:00:00 2001 From: V1K1NGbg Date: Thu, 18 Jul 2024 17:44:07 +0300 Subject: actually new manif file --- src/luarocks/core/manif.lua | 6 +++--- src/luarocks/core/path.lua | 1 - src/luarocks/core/util.lua | 10 ++++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/luarocks/core/manif.lua b/src/luarocks/core/manif.lua index c64795dc..197b4725 100644 --- a/src/luarocks/core/manif.lua +++ b/src/luarocks/core/manif.lua @@ -49,8 +49,8 @@ local manifest_cache = {} function manif.cache_manifest(repo_url, lua_version, 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 @@ -59,7 +59,7 @@ end function manif.get_cached_manifest(repo_url, lua_version) 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 diff --git a/src/luarocks/core/path.lua b/src/luarocks/core/path.lua index 20a90f79..c9bcfe5c 100644 --- a/src/luarocks/core/path.lua +++ b/src/luarocks/core/path.lua @@ -1,5 +1,4 @@ local _tl_compat; if (tonumber((_VERSION or ''):match('[%d.]*$')) or 0) < 5.3 then local p, m = pcall(require, 'compat53.module'); if p then _tl_compat = m end end; local assert = _tl_compat and _tl_compat.assert or assert; local ipairs = _tl_compat and _tl_compat.ipairs or ipairs; local package = _tl_compat and _tl_compat.package or package; local pairs = _tl_compat and _tl_compat.pairs or pairs; local string = _tl_compat and _tl_compat.string or string; local table = _tl_compat and _tl_compat.table or table - local path = {} diff --git a/src/luarocks/core/util.lua b/src/luarocks/core/util.lua index 8c995fa6..6011e51e 100644 --- a/src/luarocks/core/util.lua +++ b/src/luarocks/core/util.lua @@ -4,6 +4,7 @@ local util = {} + local dir_sep = package.config:sub(1, 1) @@ -120,6 +121,15 @@ end + +function util.matchquote(s) + return (s:gsub("[?%-+*%[%].%%()$^]", "%%%1")) +end + + + + + function util.deep_merge(dst, src) for k, v in pairs(src) do if type(v) == "table" then -- cgit v1.2.3-55-g6feb