aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV1K1NGbg <victor@ilchev.com>2024-07-18 17:11:00 +0300
committerV1K1NGbg <victor@ilchev.com>2024-08-05 20:49:17 +0300
commit0e134a5b27fe417698d9088842e2b3344f74f9c7 (patch)
treed6a7838bbaa478c0400a657cba9d67c39fcbfa47
parent14008754b8fed731489cd0fd028a8aeac03e9836 (diff)
downloadluarocks-0e134a5b27fe417698d9088842e2b3344f74f9c7.tar.gz
luarocks-0e134a5b27fe417698d9088842e2b3344f74f9c7.tar.bz2
luarocks-0e134a5b27fe417698d9088842e2b3344f74f9c7.zip
sanity check
-rw-r--r--src/luarocks/core/cfg.d.tl31
-rw-r--r--src/luarocks/path.lua (renamed from src/luarocks/path-original.lua)0
-rw-r--r--src/luarocks/util.lua (renamed from src/luarocks/util-original.lua)0
-rw-r--r--src/luarocks/util.tl39
4 files changed, 33 insertions, 37 deletions
diff --git a/src/luarocks/core/cfg.d.tl b/src/luarocks/core/cfg.d.tl
index 5c34f29e..1cc35061 100644
--- a/src/luarocks/core/cfg.d.tl
+++ b/src/luarocks/core/cfg.d.tl
@@ -22,10 +22,39 @@ local record cfg
22 lib_dir: string 22 lib_dir: string
23 end 23 end
24 -- util 24 -- util
25 record Source
26 url: string
27 end
28
29 record Description
30 summary: string
31 detailed: string
32 homepage: string
33 issues_url: string
34 maintainer: string
35 license: string
36 end
37
38 record Test
39 type: string
40 platforms: {{string: any}}
41 end
42
43 record Rockspec --? luarocks-dev-1.rockspec
44 rockspec_format: string
45 name: string --? package
46 version: string
47 source: {Source}
48 description: Description
49 test_dependencies: {string}
50 test: Test
51 format_is_at_least: function(Rockspec, string): boolean
52 end
53
25 record cache 54 record cache
26 luajit_version_checked: boolean 55 luajit_version_checked: boolean
27 luajit_version: string 56 luajit_version: string
28 rocks_provided: {Rockspec} --! import? or move? 57 rocks_provided: {Rockspec}
29 end 58 end
30 record variables 59 record variables
31 LUA: string 60 LUA: string
diff --git a/src/luarocks/path-original.lua b/src/luarocks/path.lua
index 19657c83..19657c83 100644
--- a/src/luarocks/path-original.lua
+++ b/src/luarocks/path.lua
diff --git a/src/luarocks/util-original.lua b/src/luarocks/util.lua
index de9157fc..de9157fc 100644
--- a/src/luarocks/util-original.lua
+++ b/src/luarocks/util.lua
diff --git a/src/luarocks/util.tl b/src/luarocks/util.tl
index 70b499b8..bc6ddecd 100644
--- a/src/luarocks/util.tl
+++ b/src/luarocks/util.tl
@@ -5,6 +5,7 @@
5-- as this is used in the bootstrapping stage of luarocks.core.cfg. 5-- as this is used in the bootstrapping stage of luarocks.core.cfg.
6 6
7local core = require("luarocks.core.util") 7local core = require("luarocks.core.util")
8local cfg = require("luarocks.core.cfg")
8 9
9local type CompFn = core.CompFn 10local type CompFn = core.CompFn
10 11
@@ -26,35 +27,6 @@ local record util
26 args: {any: any} 27 args: {any: any}
27 end 28 end
28 29
29 record Source
30 url: string
31 end
32
33 record Description
34 summary: string
35 detailed: string
36 homepage: string
37 issues_url: string
38 maintainer: string
39 license: string
40 end
41
42 record Test
43 type: string
44 platforms: {{string: any}}
45 end
46
47 record Rockspec -- luarocks-dev-1.rockspec
48 rockspec_format: string
49 name: string --? package
50 version: string
51 source: {Source}
52 description: Description
53 test_dependencies: {string}
54 test: Test
55 format_is_at_least: function(Rockspec, string): boolean
56 end
57
58 record Parser --? 30 record Parser --?
59 option: function(Parser, ...: string): Parser 31 option: function(Parser, ...: string): Parser
60 argname: function(Parser, string): Parser 32 argname: function(Parser, string): Parser
@@ -77,7 +49,7 @@ util.keys = core.keys
77util.matchquote = core.matchquote 49util.matchquote = core.matchquote
78 50
79local type Fn = util.Fn 51local type Fn = util.Fn
80local type Rockspec = util.Rockspec 52local type Rockspec = cfg.Rockspec
81local type Parser = util.Parser 53local type Parser = util.Parser
82 54
83local scheduled_functions: {Fn} = {} --? infered from line 48-51 55local scheduled_functions: {Fn} = {} --? infered from line 48-51
@@ -206,7 +178,6 @@ function util.lua_versions(sort: string): function(): string
206end 178end
207 179
208function util.lua_path_variables(): string, string 180function util.lua_path_variables(): string, string
209 local cfg = require("luarocks.core.cfg")
210 local lpath_var = "LUA_PATH" 181 local lpath_var = "LUA_PATH"
211 local lcpath_var = "LUA_CPATH" 182 local lcpath_var = "LUA_CPATH"
212 183
@@ -267,7 +238,6 @@ function util.format_rock_name(name: string, namespace: string, version: string)
267end 238end
268 239
269function util.deps_mode_option(parser: Parser, program: string) 240function util.deps_mode_option(parser: Parser, program: string)
270 local cfg = require("luarocks.core.cfg")
271 241
272 parser:option("--deps-mode", "How to handle dependencies. Four modes are supported:\n".. 242 parser:option("--deps-mode", "How to handle dependencies. Four modes are supported:\n"..
273 "* all - use all trees from the rocks_trees list for finding dependencies\n".. 243 "* all - use all trees from the rocks_trees list for finding dependencies\n"..
@@ -297,7 +267,6 @@ function util.see_also(text: string): string
297end 267end
298 268
299function util.announce_install(rockspec: Rockspec) 269function util.announce_install(rockspec: Rockspec)
300 local cfg = require("luarocks.core.cfg")
301 local path = require("luarocks.core.path") --TEAL BUG? 270 local path = require("luarocks.core.path") --TEAL BUG?
302 271
303 local suffix = "" 272 local suffix = ""
@@ -484,8 +453,7 @@ do
484 end 453 end
485 454
486 function util.get_luajit_version(): string --? cfg.cache.luajit_version no context 455 function util.get_luajit_version(): string --? cfg.cache.luajit_version no context
487 local cfg = require("luarocks.core.cfg") 456 if cfg.cache.luajit_version_checked then
488 if cfg.cache.luajit_version_checked then
489 return cfg.cache.luajit_version 457 return cfg.cache.luajit_version
490 end 458 end
491 cfg.cache.luajit_version_checked = true 459 cfg.cache.luajit_version_checked = true
@@ -638,7 +606,6 @@ end
638-- specifying modules that are already provided by the VM (including 606-- specifying modules that are already provided by the VM (including
639-- "lua" for the Lua version and, for format 3.0+, "luajit" if detected). 607-- "lua" for the Lua version and, for format 3.0+, "luajit" if detected).
640function util.get_rocks_provided(rockspec: Rockspec): {Rockspec} 608function util.get_rocks_provided(rockspec: Rockspec): {Rockspec}
641 local cfg = require("luarocks.core.cfg")
642 609
643 if not rockspec and cfg.cache.rocks_provided then --rocks_provided: Rockspec 610 if not rockspec and cfg.cache.rocks_provided then --rocks_provided: Rockspec
644 return cfg.cache.rocks_provided 611 return cfg.cache.rocks_provided