aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV1K1NGbg <victor@ilchev.com>2024-07-18 17:44:07 +0300
committerV1K1NGbg <victor@ilchev.com>2024-08-05 20:49:17 +0300
commit0555546ceeebe47899bf755b01f459eff0cebe08 (patch)
treeb64cd713eb5a188afb5759f628b4e59145beba27
parent909df28e57d03c39d8affbd733f01a7fe76a6d04 (diff)
downloadluarocks-0555546ceeebe47899bf755b01f459eff0cebe08.tar.gz
luarocks-0555546ceeebe47899bf755b01f459eff0cebe08.tar.bz2
luarocks-0555546ceeebe47899bf755b01f459eff0cebe08.zip
actually new manif file
-rw-r--r--src/luarocks/core/manif.lua6
-rw-r--r--src/luarocks/core/path.lua1
-rw-r--r--src/luarocks/core/util.lua10
3 files changed, 13 insertions, 4 deletions
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 = {}
49 49
50function manif.cache_manifest(repo_url, lua_version, manifest) 50function manif.cache_manifest(repo_url, lua_version, 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 56
@@ -59,7 +59,7 @@ end
59 59
60function manif.get_cached_manifest(repo_url, lua_version) 60function manif.get_cached_manifest(repo_url, lua_version)
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 65
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 @@
1local _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 1local _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
2
3local path = {} 2local path = {}
4 3
5 4
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 = {}
4 4
5 5
6 6
7
7local dir_sep = package.config:sub(1, 1) 8local dir_sep = package.config:sub(1, 1)
8 9
9 10
@@ -120,6 +121,15 @@ end
120 121
121 122
122 123
124
125function util.matchquote(s)
126 return (s:gsub("[?%-+*%[%].%%()$^]", "%%%1"))
127end
128
129
130
131
132
123function util.deep_merge(dst, src) 133function util.deep_merge(dst, src)
124 for k, v in pairs(src) do 134 for k, v in pairs(src) do
125 if type(v) == "table" then 135 if type(v) == "table" then