aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV1K1NGbg <victor@ilchev.com>2024-08-21 12:08:29 +0300
committerV1K1NGbg <victor@ilchev.com>2024-08-21 12:08:29 +0300
commit33d0e118f6f1306e10f3c13bf7a680c9548cbdaa (patch)
tree7ab690e98d65274d2a85e88d3ab647ab37d97f0b
parent016c5c90704ee6207bd100c0f4384254fd86d8c6 (diff)
downloadluarocks-33d0e118f6f1306e10f3c13bf7a680c9548cbdaa.tar.gz
luarocks-33d0e118f6f1306e10f3c13bf7a680c9548cbdaa.tar.bz2
luarocks-33d0e118f6f1306e10f3c13bf7a680c9548cbdaa.zip
regenerate all files
-rw-r--r--src/luarocks/admin/cmd/add.lua1
-rw-r--r--src/luarocks/admin/cmd/make_manifest.lua1
-rw-r--r--src/luarocks/admin/cmd/refresh_cache.lua1
-rw-r--r--src/luarocks/admin/cmd/remove.lua1
-rw-r--r--src/luarocks/admin/index.lua1
-rw-r--r--src/luarocks/build/builtin.lua4
-rw-r--r--src/luarocks/build/cmake.lua2
-rw-r--r--src/luarocks/build/command.lua2
-rw-r--r--src/luarocks/build/make.lua2
-rw-r--r--src/luarocks/cmd.lua3
-rw-r--r--src/luarocks/cmd/build.lua2
-rw-r--r--src/luarocks/cmd/config.lua1
-rw-r--r--src/luarocks/cmd/doc.lua1
-rw-r--r--src/luarocks/cmd/download.lua1
-rw-r--r--src/luarocks/cmd/init.lua3
-rw-r--r--src/luarocks/cmd/install.lua2
-rw-r--r--src/luarocks/cmd/lint.lua1
-rw-r--r--src/luarocks/cmd/list.lua3
-rw-r--r--src/luarocks/cmd/make.lua2
-rw-r--r--src/luarocks/cmd/new_version.lua3
-rw-r--r--src/luarocks/cmd/pack.lua1
-rw-r--r--src/luarocks/cmd/path.lua1
-rw-r--r--src/luarocks/cmd/purge.lua1
-rw-r--r--src/luarocks/cmd/remove.lua1
-rw-r--r--src/luarocks/cmd/search.lua2
-rw-r--r--src/luarocks/cmd/show.lua3
-rw-r--r--src/luarocks/cmd/test.lua1
-rw-r--r--src/luarocks/cmd/unpack.lua2
-rw-r--r--src/luarocks/cmd/upload.lua1
-rw-r--r--src/luarocks/cmd/which.lua27
-rw-r--r--src/luarocks/cmd/write_rockspec.lua4
-rw-r--r--src/luarocks/core/dir.lua3
-rw-r--r--src/luarocks/core/manif.lua27
-rw-r--r--src/luarocks/core/path.lua3
-rw-r--r--src/luarocks/core/sysdetect.lua1
-rw-r--r--src/luarocks/core/types/query.lua1
-rw-r--r--src/luarocks/core/types/result.lua1
-rw-r--r--src/luarocks/core/types/rockspec.lua2
-rw-r--r--src/luarocks/core/util.lua3
-rw-r--r--src/luarocks/core/vers.lua1
-rw-r--r--src/luarocks/deplocks.lua1
-rw-r--r--src/luarocks/deps.lua15
-rw-r--r--src/luarocks/dir.lua4
-rw-r--r--src/luarocks/fetch/cvs.lua5
-rw-r--r--src/luarocks/fetch/git.lua1
-rw-r--r--src/luarocks/fetch/git_file.lua1
-rw-r--r--src/luarocks/fetch/git_http.lua1
-rw-r--r--src/luarocks/fetch/git_ssh.lua1
-rw-r--r--src/luarocks/fetch/hg.lua1
-rw-r--r--src/luarocks/fetch/hg_http.lua1
-rw-r--r--src/luarocks/fetch/sscm.lua7
-rw-r--r--src/luarocks/fetch/svn.lua15
-rw-r--r--src/luarocks/fun.lua32
-rw-r--r--src/luarocks/manif.lua4
-rw-r--r--src/luarocks/manif/writer.lua5
-rw-r--r--src/luarocks/pack.lua3
-rw-r--r--src/luarocks/path.lua1
-rw-r--r--src/luarocks/persist.lua11
-rw-r--r--src/luarocks/queries.lua7
-rw-r--r--src/luarocks/remove.lua1
-rw-r--r--src/luarocks/repos.lua3
-rw-r--r--src/luarocks/results.lua19
-rw-r--r--src/luarocks/rockspecs.lua2
-rw-r--r--src/luarocks/search.lua5
-rw-r--r--src/luarocks/test.lua2
-rw-r--r--src/luarocks/test/busted.lua2
-rw-r--r--src/luarocks/test/command.lua7
-rw-r--r--src/luarocks/tools/patch.lua2
-rw-r--r--src/luarocks/tools/zip.lua4
-rw-r--r--src/luarocks/type/manifest.lua2
-rw-r--r--src/luarocks/type/rockspec.lua2
-rw-r--r--src/luarocks/upload/api.lua11
-rw-r--r--src/luarocks/util.lua5
73 files changed, 79 insertions, 227 deletions
diff --git a/src/luarocks/admin/cmd/add.lua b/src/luarocks/admin/cmd/add.lua
index 29b9e705..e94e9018 100644
--- a/src/luarocks/admin/cmd/add.lua
+++ b/src/luarocks/admin/cmd/add.lua
@@ -17,7 +17,6 @@ local argparse = require("luarocks.vendor.argparse")
17 17
18 18
19 19
20
21function add.add_to_parser(parser) 20function add.add_to_parser(parser)
22 local cmd = parser:command("add", "Add a rock or rockspec to a rocks server.", util.see_also()) 21 local cmd = parser:command("add", "Add a rock or rockspec to a rocks server.", util.see_also())
23 22
diff --git a/src/luarocks/admin/cmd/make_manifest.lua b/src/luarocks/admin/cmd/make_manifest.lua
index d2be94bb..2fe13fe3 100644
--- a/src/luarocks/admin/cmd/make_manifest.lua
+++ b/src/luarocks/admin/cmd/make_manifest.lua
@@ -17,7 +17,6 @@ local argparse = require("luarocks.vendor.argparse")
17 17
18 18
19 19
20
21function make_manifest.add_to_parser(parser) 20function make_manifest.add_to_parser(parser)
22 local cmd = parser:command("make_manifest", "Compile a manifest file for a repository.", util.see_also()) 21 local cmd = parser:command("make_manifest", "Compile a manifest file for a repository.", util.see_also())
23 22
diff --git a/src/luarocks/admin/cmd/refresh_cache.lua b/src/luarocks/admin/cmd/refresh_cache.lua
index 9565be45..cf63021e 100644
--- a/src/luarocks/admin/cmd/refresh_cache.lua
+++ b/src/luarocks/admin/cmd/refresh_cache.lua
@@ -12,7 +12,6 @@ local argparse = require("luarocks.vendor.argparse")
12 12
13 13
14 14
15
16function refresh_cache.add_to_parser(parser) 15function refresh_cache.add_to_parser(parser)
17 local cmd = parser:command("refresh_cache", "Refresh local cache of a remote rocks server.", util.see_also()) 16 local cmd = parser:command("refresh_cache", "Refresh local cache of a remote rocks server.", util.see_also())
18 17
diff --git a/src/luarocks/admin/cmd/remove.lua b/src/luarocks/admin/cmd/remove.lua
index 619a7354..a24cf76f 100644
--- a/src/luarocks/admin/cmd/remove.lua
+++ b/src/luarocks/admin/cmd/remove.lua
@@ -17,7 +17,6 @@ local argparse = require("luarocks.vendor.argparse")
17 17
18 18
19 19
20
21function admin_remove.add_to_parser(parser) 20function admin_remove.add_to_parser(parser)
22 local cmd = parser:command("remove", "Remove a rock or rockspec from a rocks server.", util.see_also()) 21 local cmd = parser:command("remove", "Remove a rock or rockspec from a rocks server.", util.see_also())
23 22
diff --git a/src/luarocks/admin/index.lua b/src/luarocks/admin/index.lua
index 8fec0f6f..e2e2deff 100644
--- a/src/luarocks/admin/index.lua
+++ b/src/luarocks/admin/index.lua
@@ -14,7 +14,6 @@ local manif = require("luarocks.manif")
14 14
15 15
16 16
17
18local ext_url_target = ' target="_blank"' 17local ext_url_target = ' target="_blank"'
19 18
20local index_header = [[ 19local index_header = [[
diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua
index 853b0318..2074218e 100644
--- a/src/luarocks/build/builtin.lua
+++ b/src/luarocks/build/builtin.lua
@@ -13,8 +13,6 @@ local builtin = {}
13 13
14 14
15 15
16
17
18builtin.skip_lua_inc_lib_check = true 16builtin.skip_lua_inc_lib_check = true
19 17
20local dir_sep = package.config:sub(1, 1) 18local dir_sep = package.config:sub(1, 1)
@@ -104,7 +102,7 @@ do
104 if bindir then 102 if bindir then
105 install = { bin = {} } 103 install = { bin = {} }
106 for _, file in ipairs(fs.list_dir(bindir)) do 104 for _, file in ipairs(fs.list_dir(bindir)) do
107 table.insert(install.bin, dir.path(bindir, file)) 105 table.insert((install.bin), dir.path(bindir, file))
108 end 106 end
109 end 107 end
110 108
diff --git a/src/luarocks/build/cmake.lua b/src/luarocks/build/cmake.lua
index ea245444..aae99487 100644
--- a/src/luarocks/build/cmake.lua
+++ b/src/luarocks/build/cmake.lua
@@ -15,8 +15,6 @@ local cfg = require("luarocks.core.cfg")
15 15
16 16
17 17
18
19
20function cmake.run(rockspec, no_install) 18function cmake.run(rockspec, no_install)
21 local build = rockspec.build 19 local build = rockspec.build
22 local variables = build.variables or {} 20 local variables = build.variables or {}
diff --git a/src/luarocks/build/command.lua b/src/luarocks/build/command.lua
index 181bc56b..8a1de8e2 100644
--- a/src/luarocks/build/command.lua
+++ b/src/luarocks/build/command.lua
@@ -15,8 +15,6 @@ local cfg = require("luarocks.core.cfg")
15 15
16 16
17 17
18
19
20function command.run(rockspec, not_install) 18function command.run(rockspec, not_install)
21 19
22 local build = rockspec.build 20 local build = rockspec.build
diff --git a/src/luarocks/build/make.lua b/src/luarocks/build/make.lua
index 6601c637..5fbc61c4 100644
--- a/src/luarocks/build/make.lua
+++ b/src/luarocks/build/make.lua
@@ -21,8 +21,6 @@ local cfg = require("luarocks.core.cfg")
21 21
22 22
23 23
24
25
26local function make_pass(make_cmd, pass, target, variables) 24local function make_pass(make_cmd, pass, target, variables)
27 local assignments = {} 25 local assignments = {}
28 for k, v in pairs(variables) do 26 for k, v in pairs(variables) do
diff --git a/src/luarocks/cmd.lua b/src/luarocks/cmd.lua
index 3cf565bf..9db7a4cd 100644
--- a/src/luarocks/cmd.lua
+++ b/src/luarocks/cmd.lua
@@ -36,9 +36,6 @@ local argparse = require("luarocks.vendor.argparse")
36 36
37 37
38 38
39
40
41
42local hc_ok, hardcoded = pcall(require, "luarocks.core.hardcoded") 39local hc_ok, hardcoded = pcall(require, "luarocks.core.hardcoded")
43if not hc_ok then 40if not hc_ok then
44 hardcoded = {} 41 hardcoded = {}
diff --git a/src/luarocks/cmd/build.lua b/src/luarocks/cmd/build.lua
index 6aa3afe0..b66efd72 100644
--- a/src/luarocks/cmd/build.lua
+++ b/src/luarocks/cmd/build.lua
@@ -28,8 +28,6 @@ local argparse = require("luarocks.vendor.argparse")
28 28
29 29
30 30
31
32
33function cmd_build.add_to_parser(parser) 31function cmd_build.add_to_parser(parser)
34 local cmd = parser:command("build", "Build and install a rock, compiling its C parts if any.\n" .. 32 local cmd = parser:command("build", "Build and install a rock, compiling its C parts if any.\n" ..
35 "If the sources contain a luarocks.lock file, uses it as an authoritative source for " .. 33 "If the sources contain a luarocks.lock file, uses it as an authoritative source for " ..
diff --git a/src/luarocks/cmd/config.lua b/src/luarocks/cmd/config.lua
index c2dd7d82..e4f4cf88 100644
--- a/src/luarocks/cmd/config.lua
+++ b/src/luarocks/cmd/config.lua
@@ -19,7 +19,6 @@ local argparse = require("luarocks.vendor.argparse")
19 19
20 20
21 21
22
23function config_cmd.add_to_parser(parser) 22function config_cmd.add_to_parser(parser)
24 local cmd = parser:command("config", [[ 23 local cmd = parser:command("config", [[
25Query information about the LuaRocks configuration. 24Query information about the LuaRocks configuration.
diff --git a/src/luarocks/cmd/doc.lua b/src/luarocks/cmd/doc.lua
index 52846337..9ec27aad 100644
--- a/src/luarocks/cmd/doc.lua
+++ b/src/luarocks/cmd/doc.lua
@@ -18,7 +18,6 @@ local argparse = require("luarocks.vendor.argparse")
18 18
19 19
20 20
21
22function doc.add_to_parser(parser) 21function doc.add_to_parser(parser)
23 local cmd = parser:command("doc", "Show documentation for an installed rock.\n\n" .. 22 local cmd = parser:command("doc", "Show documentation for an installed rock.\n\n" ..
24 "Without any flags, tries to load the documentation using a series of heuristics.\n" .. 23 "Without any flags, tries to load the documentation using a series of heuristics.\n" ..
diff --git a/src/luarocks/cmd/download.lua b/src/luarocks/cmd/download.lua
index 9ae2fa27..62f071e1 100644
--- a/src/luarocks/cmd/download.lua
+++ b/src/luarocks/cmd/download.lua
@@ -12,7 +12,6 @@ local argparse = require("luarocks.vendor.argparse")
12 12
13 13
14 14
15
16function cmd_download.add_to_parser(parser) 15function cmd_download.add_to_parser(parser)
17 local cmd = parser:command("download", "Download a specific rock file from a rocks server.", util.see_also()) 16 local cmd = parser:command("download", "Download a specific rock file from a rocks server.", util.see_also())
18 17
diff --git a/src/luarocks/cmd/init.lua b/src/luarocks/cmd/init.lua
index 4e1765a1..4eb47629 100644
--- a/src/luarocks/cmd/init.lua
+++ b/src/luarocks/cmd/init.lua
@@ -22,9 +22,6 @@ local argparse = require("luarocks.vendor.argparse")
22 22
23 23
24 24
25
26
27
28function init.add_to_parser(parser) 25function init.add_to_parser(parser)
29 local cmd = parser:command("init", "Initialize a directory for a Lua project using LuaRocks.", util.see_also()) 26 local cmd = parser:command("init", "Initialize a directory for a Lua project using LuaRocks.", util.see_also())
30 27
diff --git a/src/luarocks/cmd/install.lua b/src/luarocks/cmd/install.lua
index 11e36b8c..d5f62a89 100644
--- a/src/luarocks/cmd/install.lua
+++ b/src/luarocks/cmd/install.lua
@@ -25,8 +25,6 @@ local argparse = require("luarocks.vendor.argparse")
25 25
26 26
27 27
28
29
30function install.add_to_parser(parser) 28function install.add_to_parser(parser)
31 local cmd = parser:command("install", "Install a rock.", util.see_also()) 29 local cmd = parser:command("install", "Install a rock.", util.see_also())
32 30
diff --git a/src/luarocks/cmd/lint.lua b/src/luarocks/cmd/lint.lua
index cfff66c0..6c064645 100644
--- a/src/luarocks/cmd/lint.lua
+++ b/src/luarocks/cmd/lint.lua
@@ -13,7 +13,6 @@ local argparse = require("luarocks.vendor.argparse")
13 13
14 14
15 15
16
17function lint.add_to_parser(parser) 16function lint.add_to_parser(parser)
18 local cmd = parser:command("lint", "Check syntax of a rockspec.\n\n" .. 17 local cmd = parser:command("lint", "Check syntax of a rockspec.\n\n" ..
19 "Returns success if the text of the rockspec is syntactically correct, else failure.", 18 "Returns success if the text of the rockspec is syntactically correct, else failure.",
diff --git a/src/luarocks/cmd/list.lua b/src/luarocks/cmd/list.lua
index 96a95bc3..bfd985bc 100644
--- a/src/luarocks/cmd/list.lua
+++ b/src/luarocks/cmd/list.lua
@@ -28,9 +28,6 @@ local argparse = require("luarocks.vendor.argparse")
28 28
29 29
30 30
31
32
33
34function list.add_to_parser(parser) 31function list.add_to_parser(parser)
35 local cmd = parser:command("list", "List currently installed rocks.", util.see_also()) 32 local cmd = parser:command("list", "List currently installed rocks.", util.see_also())
36 33
diff --git a/src/luarocks/cmd/make.lua b/src/luarocks/cmd/make.lua
index f373c94e..5855bef2 100644
--- a/src/luarocks/cmd/make.lua
+++ b/src/luarocks/cmd/make.lua
@@ -24,8 +24,6 @@ local argparse = require("luarocks.vendor.argparse")
24 24
25 25
26 26
27
28
29function make.cmd_options(parser) 27function make.cmd_options(parser)
30 parser:flag("--no-install", "Do not install the rock.") 28 parser:flag("--no-install", "Do not install the rock.")
31 parser:flag("--no-doc", "Install the rock without its documentation.") 29 parser:flag("--no-doc", "Install the rock without its documentation.")
diff --git a/src/luarocks/cmd/new_version.lua b/src/luarocks/cmd/new_version.lua
index 33b98801..9e5508dd 100644
--- a/src/luarocks/cmd/new_version.lua
+++ b/src/luarocks/cmd/new_version.lua
@@ -21,9 +21,6 @@ local argparse = require("luarocks.vendor.argparse")
21 21
22 22
23 23
24
25
26
27function new_version.add_to_parser(parser) 24function new_version.add_to_parser(parser)
28 local cmd = parser:command("new_version", [[ 25 local cmd = parser:command("new_version", [[
29This is a utility function that writes a new rockspec, updating data from a 26This is a utility function that writes a new rockspec, updating data from a
diff --git a/src/luarocks/cmd/pack.lua b/src/luarocks/cmd/pack.lua
index 88268a0a..c5342d8e 100644
--- a/src/luarocks/cmd/pack.lua
+++ b/src/luarocks/cmd/pack.lua
@@ -13,7 +13,6 @@ local argparse = require("luarocks.vendor.argparse")
13 13
14 14
15 15
16
17function cmd_pack.add_to_parser(parser) 16function cmd_pack.add_to_parser(parser)
18 local cmd = parser:command("pack", "Create a rock, packing sources or binaries.", util.see_also()) 17 local cmd = parser:command("pack", "Create a rock, packing sources or binaries.", util.see_also())
19 18
diff --git a/src/luarocks/cmd/path.lua b/src/luarocks/cmd/path.lua
index 78c1a1ec..5f54d5f7 100644
--- a/src/luarocks/cmd/path.lua
+++ b/src/luarocks/cmd/path.lua
@@ -13,7 +13,6 @@ local argparse = require("luarocks.vendor.argparse")
13 13
14 14
15 15
16
17function path_cmd.add_to_parser(parser) 16function path_cmd.add_to_parser(parser)
18 local cmd = parser:command("path", [[ 17 local cmd = parser:command("path", [[
19Returns the package path currently configured for this installation 18Returns the package path currently configured for this installation
diff --git a/src/luarocks/cmd/purge.lua b/src/luarocks/cmd/purge.lua
index 167587f0..c2c26e67 100644
--- a/src/luarocks/cmd/purge.lua
+++ b/src/luarocks/cmd/purge.lua
@@ -20,7 +20,6 @@ local argparse = require("luarocks.vendor.argparse")
20 20
21 21
22 22
23
24function purge.add_to_parser(parser) 23function purge.add_to_parser(parser)
25 24
26 local cmd = parser:command("purge", [[ 25 local cmd = parser:command("purge", [[
diff --git a/src/luarocks/cmd/remove.lua b/src/luarocks/cmd/remove.lua
index c62610d4..2afededc 100644
--- a/src/luarocks/cmd/remove.lua
+++ b/src/luarocks/cmd/remove.lua
@@ -18,7 +18,6 @@ local argparse = require("luarocks.vendor.argparse")
18 18
19 19
20 20
21
22function cmd_remove.add_to_parser(parser) 21function cmd_remove.add_to_parser(parser)
23 22
24 local cmd = parser:command("remove", [[ 23 local cmd = parser:command("remove", [[
diff --git a/src/luarocks/cmd/search.lua b/src/luarocks/cmd/search.lua
index a7569c27..b16a0eef 100644
--- a/src/luarocks/cmd/search.lua
+++ b/src/luarocks/cmd/search.lua
@@ -17,8 +17,6 @@ local argparse = require("luarocks.vendor.argparse")
17 17
18 18
19 19
20
21
22function cmd_search.add_to_parser(parser) 20function cmd_search.add_to_parser(parser)
23 local cmd = parser:command("search", "Query the LuaRocks servers.", util.see_also()) 21 local cmd = parser:command("search", "Query the LuaRocks servers.", util.see_also())
24 22
diff --git a/src/luarocks/cmd/show.lua b/src/luarocks/cmd/show.lua
index 0ae5cbc6..08d86663 100644
--- a/src/luarocks/cmd/show.lua
+++ b/src/luarocks/cmd/show.lua
@@ -36,9 +36,6 @@ local argparse = require("luarocks.vendor.argparse")
36 36
37 37
38 38
39
40
41
42function show.add_to_parser(parser) 39function show.add_to_parser(parser)
43 local cmd = parser:command("show", [[ 40 local cmd = parser:command("show", [[
44Show information about an installed rock. 41Show information about an installed rock.
diff --git a/src/luarocks/cmd/test.lua b/src/luarocks/cmd/test.lua
index 22e91366..a467eb36 100644
--- a/src/luarocks/cmd/test.lua
+++ b/src/luarocks/cmd/test.lua
@@ -12,7 +12,6 @@ local argparse = require("luarocks.vendor.argparse")
12 12
13 13
14 14
15
16function cmd_test.add_to_parser(parser) 15function cmd_test.add_to_parser(parser)
17 local cmd = parser:command("test", [[ 16 local cmd = parser:command("test", [[
18Run the test suite for the Lua project in the current directory. 17Run the test suite for the Lua project in the current directory.
diff --git a/src/luarocks/cmd/unpack.lua b/src/luarocks/cmd/unpack.lua
index 1ed9a2f5..62a5c7f0 100644
--- a/src/luarocks/cmd/unpack.lua
+++ b/src/luarocks/cmd/unpack.lua
@@ -18,8 +18,6 @@ local argparse = require("luarocks.vendor.argparse")
18 18
19 19
20 20
21
22
23function unpack.add_to_parser(parser) 21function unpack.add_to_parser(parser)
24 local cmd = parser:command("unpack", [[ 22 local cmd = parser:command("unpack", [[
25Unpacks the contents of a rock in a newly created directory. 23Unpacks the contents of a rock in a newly created directory.
diff --git a/src/luarocks/cmd/upload.lua b/src/luarocks/cmd/upload.lua
index 576fdc65..0566b8c4 100644
--- a/src/luarocks/cmd/upload.lua
+++ b/src/luarocks/cmd/upload.lua
@@ -25,7 +25,6 @@ local argparse = require("luarocks.vendor.argparse")
25 25
26 26
27 27
28
29function upload.add_to_parser(parser) 28function upload.add_to_parser(parser)
30 local cmd = parser:command("upload", "Pack a source rock file (.src.rock extension) " .. 29 local cmd = parser:command("upload", "Pack a source rock file (.src.rock extension) " ..
31 "and upload it and the rockspec to the public rocks repository.", util.see_also()): 30 "and upload it and the rockspec to the public rocks repository.", util.see_also()):
diff --git a/src/luarocks/cmd/which.lua b/src/luarocks/cmd/which.lua
index f50a43c3..a48596ce 100644
--- a/src/luarocks/cmd/which.lua
+++ b/src/luarocks/cmd/which.lua
@@ -1,24 +1,30 @@
1 1
2--- @module luarocks.which_cmd 2
3-- Driver for the `luarocks which` command. 3
4local which_cmd = {} 4local which_cmd = {}
5 5
6
6local loader = require("luarocks.loader") 7local loader = require("luarocks.loader")
7local cfg = require("luarocks.core.cfg") 8local cfg = require("luarocks.core.cfg")
8local util = require("luarocks.util") 9local util = require("luarocks.util")
9 10
11local argparse = require("luarocks.vendor.argparse")
12
13
14
15
10function which_cmd.add_to_parser(parser) 16function which_cmd.add_to_parser(parser)
11 local cmd = parser:command("which", 'Given a module name like "foo.bar", '.. 17 local cmd = parser:command("which", 'Given a module name like "foo.bar", ' ..
12 "output which file would be loaded to resolve that module by ".. 18 "output which file would be loaded to resolve that module by " ..
13 'luarocks.loader, like "/usr/local/lua/'..cfg.lua_version..'/foo/bar.lua".', 19 'luarocks.loader, like "/usr/local/lua/' .. cfg.lua_version .. '/foo/bar.lua".',
14 util.see_also()) 20 util.see_also()):
15 :summary("Tell which file corresponds to a given module name.") 21 summary("Tell which file corresponds to a given module name.")
16 22
17 cmd:argument("modname", "Module name.") 23 cmd:argument("modname", "Module name.")
18end 24end
19 25
20--- Driver function for "which" command. 26
21-- @return boolean This function terminates the interpreter. 27
22function which_cmd.command(args) 28function which_cmd.command(args)
23 local pathname, rock_name, rock_version, where = loader.which(args.modname, "lp") 29 local pathname, rock_name, rock_version, where = loader.which(args.modname, "lp")
24 30
@@ -28,7 +34,7 @@ function which_cmd.command(args)
28 util.printout("(provided by " .. tostring(rock_name) .. " " .. tostring(rock_version) .. ")") 34 util.printout("(provided by " .. tostring(rock_name) .. " " .. tostring(rock_version) .. ")")
29 else 35 else
30 local key = rock_name 36 local key = rock_name
31 util.printout("(found directly via package." .. key.. " -- not installed as a rock?)") 37 util.printout("(found directly via package." .. key .. " -- not installed as a rock?)")
32 end 38 end
33 return true 39 return true
34 end 40 end
@@ -37,4 +43,3 @@ function which_cmd.command(args)
37end 43end
38 44
39return which_cmd 45return which_cmd
40
diff --git a/src/luarocks/cmd/write_rockspec.lua b/src/luarocks/cmd/write_rockspec.lua
index 41777307..5ec26003 100644
--- a/src/luarocks/cmd/write_rockspec.lua
+++ b/src/luarocks/cmd/write_rockspec.lua
@@ -25,10 +25,6 @@ local argparse = require("luarocks.vendor.argparse")
25 25
26 26
27 27
28
29
30
31
32local lua_versions = { 28local lua_versions = {
33 "5.1", 29 "5.1",
34 "5.2", 30 "5.2",
diff --git a/src/luarocks/core/dir.lua b/src/luarocks/core/dir.lua
index 7d9702ba..b9b71c14 100644
--- a/src/luarocks/core/dir.lua
+++ b/src/luarocks/core/dir.lua
@@ -1,4 +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 string = _tl_compat and _tl_compat.string or string; local table = _tl_compat and _tl_compat.table or table; local dir = {} 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 ipairs = _tl_compat and _tl_compat.ipairs or ipairs; local package = _tl_compat and _tl_compat.package or package; local string = _tl_compat and _tl_compat.string or string; local table = _tl_compat and _tl_compat.table or table; local dir = {}
2 2
3 3
4 4
@@ -19,7 +19,6 @@ end
19 19
20 20
21function dir.split_url(url) 21function dir.split_url(url)
22 assert(type(url) == "string")
23 22
24 url = unquote(url) 23 url = unquote(url)
25 local protocol, pathname = url:match("^([^:]*)://(.*)") 24 local protocol, pathname = url:match("^([^:]*)://(.*)")
diff --git a/src/luarocks/core/manif.lua b/src/luarocks/core/manif.lua
index 197b4725..11a6cf41 100644
--- a/src/luarocks/core/manif.lua
+++ b/src/luarocks/core/manif.lua
@@ -1,4 +1,7 @@
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 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 ipairs = _tl_compat and _tl_compat.ipairs or ipairs; local table = _tl_compat and _tl_compat.table or table
2
3local manif = {}
4
2 5
3local persist = require("luarocks.core.persist") 6local persist = require("luarocks.core.persist")
4local cfg = require("luarocks.core.cfg") 7local cfg = require("luarocks.core.cfg")
@@ -10,27 +13,6 @@ local path = require("luarocks.core.path")
10 13
11 14
12 15
13local manif = {DependencyVersion = {}, Manifest = {}, Tree_manifest = {}, }
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 16
35 17
36 18
@@ -85,7 +67,6 @@ end
85 67
86 68
87function manif.fast_load_local_manifest(repo_url) 69function manif.fast_load_local_manifest(repo_url)
88 assert(type(repo_url) == "string")
89 70
90 local cached_manifest = manif.get_cached_manifest(repo_url) 71 local cached_manifest = manif.get_cached_manifest(repo_url)
91 if cached_manifest then 72 if cached_manifest then
diff --git a/src/luarocks/core/path.lua b/src/luarocks/core/path.lua
index c9bcfe5c..b88b3bfc 100644
--- a/src/luarocks/core/path.lua
+++ b/src/luarocks/core/path.lua
@@ -42,7 +42,6 @@ end
42 42
43 43
44function path.path_to_module(file) 44function path.path_to_module(file)
45 assert(type(file) == "string")
46 45
47 local exts = {} 46 local exts = {}
48 local paths = package.path .. ";" .. package.cpath 47 local paths = package.path .. ";" .. package.cpath
@@ -74,7 +73,6 @@ function path.deploy_lua_dir(tree)
74 if type(tree) == "string" then 73 if type(tree) == "string" then
75 return dir.path(tree, cfg.lua_modules_path) 74 return dir.path(tree, cfg.lua_modules_path)
76 else 75 else
77 assert(type(tree) == "table")
78 return tree.lua_dir or dir.path(tree.root, cfg.lua_modules_path) 76 return tree.lua_dir or dir.path(tree.root, cfg.lua_modules_path)
79 end 77 end
80end 78end
@@ -83,7 +81,6 @@ function path.deploy_lib_dir(tree)
83 if type(tree) == "string" then 81 if type(tree) == "string" then
84 return dir.path(tree, cfg.lib_modules_path) 82 return dir.path(tree, cfg.lib_modules_path)
85 else 83 else
86 assert(type(tree) == "table")
87 return tree.lib_dir or dir.path(tree.root, cfg.lib_modules_path) 84 return tree.lib_dir or dir.path(tree.root, cfg.lib_modules_path)
88 end 85 end
89end 86end
diff --git a/src/luarocks/core/sysdetect.lua b/src/luarocks/core/sysdetect.lua
index 40203808..3a2527f4 100644
--- a/src/luarocks/core/sysdetect.lua
+++ b/src/luarocks/core/sysdetect.lua
@@ -435,7 +435,6 @@ end
435 435
436 436
437function sysdetect.detect_file(file) 437function sysdetect.detect_file(file)
438 assert(type(file) == "string")
439 local fd = io.open(file, "rb") 438 local fd = io.open(file, "rb")
440 if not fd then 439 if not fd then
441 return nil 440 return nil
diff --git a/src/luarocks/core/types/query.lua b/src/luarocks/core/types/query.lua
index 885532a0..1fb42576 100644
--- a/src/luarocks/core/types/query.lua
+++ b/src/luarocks/core/types/query.lua
@@ -1,6 +1,5 @@
1 1
2 2
3
4local query = {Query = {}, } 3local query = {Query = {}, }
5 4
6 5
diff --git a/src/luarocks/core/types/result.lua b/src/luarocks/core/types/result.lua
index d2812eec..6e05df9a 100644
--- a/src/luarocks/core/types/result.lua
+++ b/src/luarocks/core/types/result.lua
@@ -1,6 +1,5 @@
1 1
2 2
3
4local result = {Result = {}, } 3local result = {Result = {}, }
5 4
6 5
diff --git a/src/luarocks/core/types/rockspec.lua b/src/luarocks/core/types/rockspec.lua
index d74dfa2a..18c6f485 100644
--- a/src/luarocks/core/types/rockspec.lua
+++ b/src/luarocks/core/types/rockspec.lua
@@ -2,8 +2,6 @@
2 2
3 3
4 4
5
6
7local rockspec = {Description = {}, Source = {}, Test = {}, Dependencies = {}, Hooks = {}, Deploy = {}, Rockspec = {}, } 5local rockspec = {Description = {}, Source = {}, Test = {}, Dependencies = {}, Hooks = {}, Deploy = {}, Rockspec = {}, }
8 6
9 7
diff --git a/src/luarocks/core/util.lua b/src/luarocks/core/util.lua
index 3be00136..6a457c54 100644
--- a/src/luarocks/core/util.lua
+++ b/src/luarocks/core/util.lua
@@ -7,7 +7,6 @@ local util = {}
7 7
8 8
9 9
10
11local dir_sep = package.config:sub(1, 1) 10local dir_sep = package.config:sub(1, 1)
12 11
13 12
@@ -110,7 +109,7 @@ function util.show_table(t, tname, top_indent)
110 end 109 end
111 110
112 tname = tname or "__unnamed__" 111 tname = tname or "__unnamed__"
113 if type(t) ~= "table" then 112 if not (type(t) == "table") then
114 return tname .. " = " .. basic_serialize(t) 113 return tname .. " = " .. basic_serialize(t)
115 end 114 end
116 cart, autoref = "", "" 115 cart, autoref = "", ""
diff --git a/src/luarocks/core/vers.lua b/src/luarocks/core/vers.lua
index e7c4a221..413b11d6 100644
--- a/src/luarocks/core/vers.lua
+++ b/src/luarocks/core/vers.lua
@@ -6,7 +6,6 @@ local util = require("luarocks.core.util")
6 6
7 7
8 8
9
10local deltas = { 9local deltas = {
11 dev = 120000000, 10 dev = 120000000,
12 scm = 110000000, 11 scm = 110000000,
diff --git a/src/luarocks/deplocks.lua b/src/luarocks/deplocks.lua
index cfe61e53..8a21ef1b 100644
--- a/src/luarocks/deplocks.lua
+++ b/src/luarocks/deplocks.lua
@@ -7,7 +7,6 @@ local persist = require("luarocks.persist")
7 7
8 8
9 9
10
11local deptable = {} 10local deptable = {}
12local deptable_mode = "start" 11local deptable_mode = "start"
13local deplock_abs_filename 12local deplock_abs_filename
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua
index d4ca2322..a6103946 100644
--- a/src/luarocks/deps.lua
+++ b/src/luarocks/deps.lua
@@ -3,6 +3,7 @@ local _tl_compat; if (tonumber((_VERSION or ''):match('[%d.]*$')) or 0) < 5.3 th
3local deps = {} 3local deps = {}
4 4
5 5
6
6local cfg = require("luarocks.core.cfg") 7local cfg = require("luarocks.core.cfg")
7local manif = require("luarocks.manif") 8local manif = require("luarocks.manif")
8local path = require("luarocks.path") 9local path = require("luarocks.path")
@@ -53,8 +54,6 @@ local deplocks = require("luarocks.deplocks")
53 54
54 55
55 56
56
57
58local function prepare_get_versions(deps_mode, rocks_provided, depskey, skip_set) 57local function prepare_get_versions(deps_mode, rocks_provided, depskey, skip_set)
59 58
60 return function(dep) 59 return function(dep)
@@ -223,7 +222,6 @@ function deps.fulfill_dependency(dep, deps_mode, rocks_provided, verify, depskey
223 end 222 end
224 223
225 local search = require("luarocks.search") 224 local search = require("luarocks.search")
226 local install = require("luarocks.cmd.install")
227 225
228 local url, search_err = search.find_suitable_rock(dep) 226 local url, search_err = search.find_suitable_rock(dep)
229 if not url then 227 if not url then
@@ -236,7 +234,7 @@ function deps.fulfill_dependency(dep, deps_mode, rocks_provided, verify, depskey
236 namespace = dep.namespace, 234 namespace = dep.namespace,
237 verify = verify, 235 verify = verify,
238 } 236 }
239 local ok, install_err, errcode = install.command(install_args) 237 local ok, install_err, errcode = deps.installer(install_args)
240 if not ok then 238 if not ok then
241 return nil, "Failed installing dependency: " .. url .. " - " .. install_err, errcode 239 return nil, "Failed installing dependency: " .. url .. " - " .. install_err, errcode
242 end 240 end
@@ -591,13 +589,13 @@ end
591 589
592function deps.autodetect_external_dependencies(build) 590function deps.autodetect_external_dependencies(build)
593 591
594 if not build or not build.modules then 592 if not build or not (build).modules then
595 return nil 593 return nil
596 end 594 end
597 595
598 local extdeps = {} 596 local extdeps = {}
599 local any = false 597 local any = false
600 for _, data in pairs(build.modules) do 598 for _, data in pairs((build).modules) do
601 if type(data) == "table" and data.libraries then 599 if type(data) == "table" and data.libraries then
602 local libraries 600 local libraries
603 local librariesstr = data.libraries 601 local librariesstr = data.libraries
@@ -678,8 +676,6 @@ end
678 676
679 677
680function deps.scan_deps(results, mdeps, name, version, deps_mode) 678function deps.scan_deps(results, mdeps, name, version, deps_mode)
681 assert(type(results) == "table")
682 assert(type(mdeps) == "table")
683 assert(not name:match("/")) 679 assert(not name:match("/"))
684 680
685 local fetch = require("luarocks.fetch") 681 local fetch = require("luarocks.fetch")
@@ -722,7 +718,7 @@ local function lua_h_exists(d, luaver)
722 local data = fd:read("*a") 718 local data = fd:read("*a")
723 fd:close() 719 fd:close()
724 if data:match("LUA_VERSION_NUM%s*" .. tostring(luanum)) then 720 if data:match("LUA_VERSION_NUM%s*" .. tostring(luanum)) then
725 return d 721 return d ~= nil
726 end 722 end
727 return nil, "Lua header lua.h found at " .. d .. " does not match Lua version " .. luaver .. ". You can use `luarocks config variables.LUA_INCDIR <path>` to set the correct location.", "dependency", 2 723 return nil, "Lua header lua.h found at " .. d .. " does not match Lua version " .. luaver .. ". You can use `luarocks config variables.LUA_INCDIR <path>` to set the correct location.", "dependency", 2
728 end 724 end
@@ -857,7 +853,6 @@ end
857 853
858function deps.check_dependencies(repo, deps_mode) 854function deps.check_dependencies(repo, deps_mode)
859 local rocks_dir = path.rocks_dir(repo or cfg.root_dir) 855 local rocks_dir = path.rocks_dir(repo or cfg.root_dir)
860 assert(type(deps_mode) == "string")
861 if deps_mode == "none" then deps_mode = cfg.deps_mode end 856 if deps_mode == "none" then deps_mode = cfg.deps_mode end
862 857
863 local manifest = manif.load_manifest(rocks_dir) 858 local manifest = manif.load_manifest(rocks_dir)
diff --git a/src/luarocks/dir.lua b/src/luarocks/dir.lua
index f54f1458..b9989bbe 100644
--- a/src/luarocks/dir.lua
+++ b/src/luarocks/dir.lua
@@ -1,4 +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 string = _tl_compat and _tl_compat.string or string 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 ipairs = _tl_compat and _tl_compat.ipairs or ipairs; local package = _tl_compat and _tl_compat.package or package; local string = _tl_compat and _tl_compat.string or string
2 2
3local dir = {} 3local dir = {}
4 4
@@ -19,7 +19,6 @@ local dir_sep = package.config:sub(1, 1)
19 19
20 20
21function dir.base_name(pathname) 21function dir.base_name(pathname)
22 assert(type(pathname) == "string")
23 22
24 local b 23 local b
25 b = pathname:gsub("[/\\]", "/") 24 b = pathname:gsub("[/\\]", "/")
@@ -36,7 +35,6 @@ end
36 35
37 36
38function dir.dir_name(pathname) 37function dir.dir_name(pathname)
39 assert(type(pathname) == "string")
40 38
41 local d 39 local d
42 d = pathname:gsub("[/\\]", "/") 40 d = pathname:gsub("[/\\]", "/")
diff --git a/src/luarocks/fetch/cvs.lua b/src/luarocks/fetch/cvs.lua
index 1c6616ff..6aabfb31 100644
--- a/src/luarocks/fetch/cvs.lua
+++ b/src/luarocks/fetch/cvs.lua
@@ -6,7 +6,6 @@ local cvs = {}
6local fs = require("luarocks.fs") 6local fs = require("luarocks.fs")
7local dir = require("luarocks.dir") 7local dir = require("luarocks.dir")
8local util = require("luarocks.util") 8local util = require("luarocks.util")
9local cfg = require("luarocks.core.cfg")
10 9
11 10
12 11
@@ -41,8 +40,8 @@ function cvs.get_sources(rockspec, extract, dest_dir)
41 else 40 else
42 store_dir = dest_dir 41 store_dir = dest_dir
43 end 42 end
44 local ok, err = fs.change_dir(store_dir) 43 local okchange, err = fs.change_dir(store_dir)
45 if not ok then return nil, err end 44 if not okchange then return nil, err end
46 if not fs.execute(_tl_table_unpack(command)) then 45 if not fs.execute(_tl_table_unpack(command)) then
47 return nil, "Failed fetching files from CVS." 46 return nil, "Failed fetching files from CVS."
48 end 47 end
diff --git a/src/luarocks/fetch/git.lua b/src/luarocks/fetch/git.lua
index 4e7c4bd1..048675e4 100644
--- a/src/luarocks/fetch/git.lua
+++ b/src/luarocks/fetch/git.lua
@@ -8,7 +8,6 @@ local fs = require("luarocks.fs")
8local dir = require("luarocks.dir") 8local dir = require("luarocks.dir")
9local vers = require("luarocks.core.vers") 9local vers = require("luarocks.core.vers")
10local util = require("luarocks.util") 10local util = require("luarocks.util")
11local cfg = require("luarocks.core.cfg")
12 11
13 12
14 13
diff --git a/src/luarocks/fetch/git_file.lua b/src/luarocks/fetch/git_file.lua
index 5319d9a0..40c55a4d 100644
--- a/src/luarocks/fetch/git_file.lua
+++ b/src/luarocks/fetch/git_file.lua
@@ -4,7 +4,6 @@ local git_file = {}
4 4
5 5
6local git = require("luarocks.fetch.git") 6local git = require("luarocks.fetch.git")
7local cfg = require("luarocks.core.cfg")
8 7
9 8
10 9
diff --git a/src/luarocks/fetch/git_http.lua b/src/luarocks/fetch/git_http.lua
index 42587cbb..5f660fce 100644
--- a/src/luarocks/fetch/git_http.lua
+++ b/src/luarocks/fetch/git_http.lua
@@ -11,7 +11,6 @@ local git_http = {}
11 11
12 12
13local git = require("luarocks.fetch.git") 13local git = require("luarocks.fetch.git")
14local cfg = require("luarocks.core.cfg")
15 14
16 15
17 16
diff --git a/src/luarocks/fetch/git_ssh.lua b/src/luarocks/fetch/git_ssh.lua
index 5411344f..2ab3b7f7 100644
--- a/src/luarocks/fetch/git_ssh.lua
+++ b/src/luarocks/fetch/git_ssh.lua
@@ -11,7 +11,6 @@ local git_ssh = {}
11 11
12 12
13local git = require("luarocks.fetch.git") 13local git = require("luarocks.fetch.git")
14local cfg = require("luarocks.core.cfg")
15 14
16 15
17 16
diff --git a/src/luarocks/fetch/hg.lua b/src/luarocks/fetch/hg.lua
index f63942fc..b7c3020b 100644
--- a/src/luarocks/fetch/hg.lua
+++ b/src/luarocks/fetch/hg.lua
@@ -6,7 +6,6 @@ local hg = {}
6local fs = require("luarocks.fs") 6local fs = require("luarocks.fs")
7local dir = require("luarocks.dir") 7local dir = require("luarocks.dir")
8local util = require("luarocks.util") 8local util = require("luarocks.util")
9local cfg = require("luarocks.core.cfg")
10 9
11 10
12 11
diff --git a/src/luarocks/fetch/hg_http.lua b/src/luarocks/fetch/hg_http.lua
index 2fde3698..b5b04a86 100644
--- a/src/luarocks/fetch/hg_http.lua
+++ b/src/luarocks/fetch/hg_http.lua
@@ -9,7 +9,6 @@ local hg_http = {}
9 9
10 10
11local hg = require("luarocks.fetch.hg") 11local hg = require("luarocks.fetch.hg")
12local cfg = require("luarocks.core.cfg")
13 12
14 13
15 14
diff --git a/src/luarocks/fetch/sscm.lua b/src/luarocks/fetch/sscm.lua
index 8c80885f..f635c02f 100644
--- a/src/luarocks/fetch/sscm.lua
+++ b/src/luarocks/fetch/sscm.lua
@@ -1,13 +1,12 @@
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 io = _tl_compat and _tl_compat.io or io; local string = _tl_compat and _tl_compat.string or string 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 io = _tl_compat and _tl_compat.io or io; local string = _tl_compat and _tl_compat.string or string
2 2
3local sscm = {} 3local sscm = {}
4 4
5 5
6local fs = require("luarocks.fs") 6local fs = require("luarocks.fs")
7local dir = require("luarocks.dir") 7local dir = require("luarocks.dir")
8local cfg = require("luarocks.core.cfg")
9 8
10local Rockspec = cfg.Rockspec 9
11 10
12 11
13 12
@@ -17,8 +16,6 @@ local Rockspec = cfg.Rockspec
17 16
18 17
19function sscm.get_sources(rockspec, extract, dest_dir) 18function sscm.get_sources(rockspec, extract, dest_dir)
20 assert(rockspec:type() == "rockspec")
21 assert(type(dest_dir) == "string" or not dest_dir)
22 19
23 local sscm_cmd = rockspec.variables.SSCM 20 local sscm_cmd = rockspec.variables.SSCM
24 local module = rockspec.source.module or dir.base_name(rockspec.source.url) 21 local module = rockspec.source.module or dir.base_name(rockspec.source.url)
diff --git a/src/luarocks/fetch/svn.lua b/src/luarocks/fetch/svn.lua
index eee4ce25..13e34c1e 100644
--- a/src/luarocks/fetch/svn.lua
+++ b/src/luarocks/fetch/svn.lua
@@ -1,4 +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 table = _tl_compat and _tl_compat.table or table; local _tl_table_unpack = unpack or table.unpack 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 ipairs = _tl_compat and _tl_compat.ipairs or ipairs; local table = _tl_compat and _tl_compat.table or table; local _tl_table_unpack = unpack or table.unpack
2 2
3local svn = {} 3local svn = {}
4 4
@@ -6,9 +6,8 @@ local svn = {}
6local fs = require("luarocks.fs") 6local fs = require("luarocks.fs")
7local dir = require("luarocks.dir") 7local dir = require("luarocks.dir")
8local util = require("luarocks.util") 8local util = require("luarocks.util")
9local cfg = require("luarocks.core.cfg")
10 9
11local Rockspec = cfg.Rockspec 10
12 11
13 12
14 13
@@ -18,8 +17,6 @@ local Rockspec = cfg.Rockspec
18 17
19 18
20function svn.get_sources(rockspec, extract, dest_dir) 19function svn.get_sources(rockspec, extract, dest_dir)
21 assert(rockspec:type() == "rockspec")
22 assert(type(dest_dir) == "string" or not dest_dir)
23 20
24 local svn_cmd = rockspec.variables.SVN 21 local svn_cmd = rockspec.variables.SVN
25 local ok, err_msg = fs.is_tool_available(svn_cmd, "Subversion") 22 local ok, err_msg = fs.is_tool_available(svn_cmd, "Subversion")
@@ -45,13 +42,13 @@ function svn.get_sources(rockspec, extract, dest_dir)
45 else 42 else
46 store_dir = dest_dir 43 store_dir = dest_dir
47 end 44 end
48 local ok, err = fs.change_dir(store_dir) 45 local okchange, err = fs.change_dir(store_dir)
49 if not ok then return nil, err end 46 if not okchange then return nil, err end
50 if not fs.execute(_tl_table_unpack(command)) then 47 if not fs.execute(_tl_table_unpack(command)) then
51 return nil, "Failed fetching files from Subversion." 48 return nil, "Failed fetching files from Subversion."
52 end 49 end
53 ok, err = fs.change_dir(module) 50 okchange, err = fs.change_dir(module)
54 if not ok then return nil, err end 51 if not okchange then return nil, err end
55 for _, d in ipairs(fs.find(".")) do 52 for _, d in ipairs(fs.find(".")) do
56 if dir.base_name(d) == ".svn" then 53 if dir.base_name(d) == ".svn" then
57 fs.delete(dir.path(store_dir, module, d)) 54 fs.delete(dir.path(store_dir, module, d))
diff --git a/src/luarocks/fun.lua b/src/luarocks/fun.lua
index 95f9177d..5565e7dc 100644
--- a/src/luarocks/fun.lua
+++ b/src/luarocks/fun.lua
@@ -44,17 +44,6 @@ function fun.filter(xs, f)
44 return rs 44 return rs
45end 45end
46 46
47function fun.traverse(t, f)
48 return fun.map(t, function(x)
49
50 if type(x) == "table" then
51 return fun.traverse(x, f)
52 else
53 return f(x)
54 end
55 end)
56end
57
58function fun.reverse_in(t) 47function fun.reverse_in(t)
59 for i = 1, math.floor(#t / 2) do 48 for i = 1, math.floor(#t / 2) do
60 local m, n = i, #t - i + 1 49 local m, n = i, #t - i + 1
@@ -77,23 +66,24 @@ function fun.flip(f)
77end 66end
78 67
79function fun.find(xs, f) 68function fun.find(xs, f)
80 if type(xs) == "function" then 69 if type(xs) == "table" then
81 for v in xs do 70 for _, x in ipairs(xs) do
82 local x = f(v) 71 local r = f(x)
83 if x then 72 if r then
84 return x 73 return r
85 end 74 end
86 end 75 end
87 elseif type(xs) == "table" then 76 else
88 for _, v in ipairs(xs) do 77 for x in xs do
89 local x = f(v) 78 local r = f(x)
90 if x then 79 if r then
91 return x 80 return r
92 end 81 end
93 end 82 end
94 end 83 end
95end 84end
96 85
86
97function fun.partial(f, ...) 87function fun.partial(f, ...)
98 local n = select("#", ...) 88 local n = select("#", ...)
99 if n == 1 then 89 if n == 1 then
diff --git a/src/luarocks/manif.lua b/src/luarocks/manif.lua
index 437ebe3b..27144894 100644
--- a/src/luarocks/manif.lua
+++ b/src/luarocks/manif.lua
@@ -12,7 +12,6 @@ local manif = {}
12 12
13 13
14 14
15
16local core = require("luarocks.core.manif") 15local core = require("luarocks.core.manif")
17local persist = require("luarocks.persist") 16local persist = require("luarocks.persist")
18local fetch = require("luarocks.fetch") 17local fetch = require("luarocks.fetch")
@@ -29,9 +28,6 @@ local type_manifest = require("luarocks.type.manifest")
29 28
30 29
31 30
32
33
34
35manif.cache_manifest = core.cache_manifest 31manif.cache_manifest = core.cache_manifest
36manif.load_rocks_tree_manifests = core.load_rocks_tree_manifests 32manif.load_rocks_tree_manifests = core.load_rocks_tree_manifests
37manif.scan_dependencies = core.scan_dependencies 33manif.scan_dependencies = core.scan_dependencies
diff --git a/src/luarocks/manif/writer.lua b/src/luarocks/manif/writer.lua
index 10dd6743..689bcc6a 100644
--- a/src/luarocks/manif/writer.lua
+++ b/src/luarocks/manif/writer.lua
@@ -34,11 +34,6 @@ local queries = require("luarocks.queries")
34 34
35 35
36 36
37
38
39
40
41
42local function store_package_items(storage, name, version, items) 37local function store_package_items(storage, name, version, items)
43 assert(not name:match("/")) 38 assert(not name:match("/"))
44 39
diff --git a/src/luarocks/pack.lua b/src/luarocks/pack.lua
index 59f0c8cf..5b230d28 100644
--- a/src/luarocks/pack.lua
+++ b/src/luarocks/pack.lua
@@ -28,9 +28,6 @@ local signing = require("luarocks.signing")
28 28
29 29
30 30
31
32
33
34function pack.pack_source_rock(rockspec_file) 31function pack.pack_source_rock(rockspec_file)
35 32
36 local rockspec, errload = fetch.load_rockspec(rockspec_file) 33 local rockspec, errload = fetch.load_rockspec(rockspec_file)
diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua
index 5a77cf68..65c1a7d2 100644
--- a/src/luarocks/path.lua
+++ b/src/luarocks/path.lua
@@ -10,7 +10,6 @@ local util = require("luarocks.core.util")
10 10
11 11
12 12
13
14local path = {} 13local path = {}
15 14
16 15
diff --git a/src/luarocks/persist.lua b/src/luarocks/persist.lua
index eb501f2e..d2d17f96 100644
--- a/src/luarocks/persist.lua
+++ b/src/luarocks/persist.lua
@@ -1,7 +1,12 @@
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 io = _tl_compat and _tl_compat.io or io; 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 io = _tl_compat and _tl_compat.io or io; local string = _tl_compat and _tl_compat.string or string; local table = _tl_compat and _tl_compat.table or table
2 2
3 3
4local persist = {} 4local persist = {Writer = {}, }
5
6
7
8
9
5 10
6 11
7 12
@@ -15,13 +20,13 @@ local cfg = require("luarocks.core.cfg")
15 20
16 21
17 22
18persist.run_file = core.run_file
19persist.load_into_table = core.load_into_table
20 23
21 24
22 25
23 26
24 27
28persist.run_file = core.run_file
29persist.load_into_table = core.load_into_table
25 30
26local write_table 31local write_table
27 32
diff --git a/src/luarocks/queries.lua b/src/luarocks/queries.lua
index 12eb9237..0a3f7150 100644
--- a/src/luarocks/queries.lua
+++ b/src/luarocks/queries.lua
@@ -12,7 +12,6 @@ local query = require("luarocks.core.types.query")
12 12
13 13
14 14
15
16local query_mt = {} 15local query_mt = {}
17 16
18query_mt.__index = query.Query 17query_mt.__index = query.Query
@@ -58,11 +57,6 @@ end
58 57
59function queries.new(name, namespace, version, substring, arch, operator) 58function queries.new(name, namespace, version, substring, arch, operator)
60 59
61
62
63
64
65
66 operator = operator or "==" 60 operator = operator or "=="
67 61
68 local self = { 62 local self = {
@@ -84,7 +78,6 @@ end
84 78
85function queries.all(arch) 79function queries.all(arch)
86 80
87
88 return queries.new("", nil, nil, true, arch) 81 return queries.new("", nil, nil, true, arch)
89end 82end
90 83
diff --git a/src/luarocks/remove.lua b/src/luarocks/remove.lua
index 386bccb0..72d3a1d8 100644
--- a/src/luarocks/remove.lua
+++ b/src/luarocks/remove.lua
@@ -21,7 +21,6 @@ local queries = require("luarocks.queries")
21 21
22 22
23 23
24
25local function check_dependents(name, versions, deps_mode) 24local function check_dependents(name, versions, deps_mode)
26 local dependents = {} 25 local dependents = {}
27 26
diff --git a/src/luarocks/repos.lua b/src/luarocks/repos.lua
index c1d80fc8..0b8cd61e 100644
--- a/src/luarocks/repos.lua
+++ b/src/luarocks/repos.lua
@@ -55,9 +55,6 @@ local vers = require("luarocks.core.vers")
55 55
56 56
57 57
58
59
60
61local function get_installed_versions(name) 58local function get_installed_versions(name)
62 assert(not name:match("/")) 59 assert(not name:match("/"))
63 60
diff --git a/src/luarocks/results.lua b/src/luarocks/results.lua
index a945c48b..dd17e686 100644
--- a/src/luarocks/results.lua
+++ b/src/luarocks/results.lua
@@ -1,25 +1,18 @@
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 string = _tl_compat and _tl_compat.string or string; local results = {Results = {}, } 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 string = _tl_compat and _tl_compat.string or string; local results = {}
2
3
4
5
6
7
8
9 2
10 3
11local vers = require("luarocks.core.vers") 4local vers = require("luarocks.core.vers")
12local util = require("luarocks.util") 5local util = require("luarocks.util")
13local queries = require("luarocks.queries")
14 6
15 7
8local result = require("luarocks.core.types.result")
16 9
17 10
18local result_mt = {} 11local result_mt = {}
19 12
20result_mt.__index = results.Results 13result_mt.__index = result.Result
21 14
22function results.Results.type() 15function result.Result.type()
23 return "result" 16 return "result"
24end 17end
25 18
@@ -28,8 +21,6 @@ function results.new(name, version, repo, arch, namespace)
28 assert(not name:match("/")) 21 assert(not name:match("/"))
29 22
30 23
31
32
33 if not namespace then 24 if not namespace then
34 name, namespace = util.split_namespace(name) 25 name, namespace = util.split_namespace(name)
35 end 26 end
@@ -63,7 +54,7 @@ end
63 54
64 55
65 56
66function results.Results:satisfies(query) 57function result.Result:satisfies(query)
67 return match_name(query, self.name) and 58 return match_name(query, self.name) and
68 (query.arch[self.arch] or query.arch["any"]) and 59 (query.arch[self.arch] or query.arch["any"]) and
69 ((not query.namespace) or (query.namespace == self.namespace)) and 60 ((not query.namespace) or (query.namespace == self.namespace)) and
diff --git a/src/luarocks/rockspecs.lua b/src/luarocks/rockspecs.lua
index 1953aec8..5b83f90b 100644
--- a/src/luarocks/rockspecs.lua
+++ b/src/luarocks/rockspecs.lua
@@ -16,8 +16,6 @@ local rock = require("luarocks.core.types.rockspec")
16 16
17 17
18 18
19
20
21local vendored_build_type_set = { 19local vendored_build_type_set = {
22 ["builtin"] = true, 20 ["builtin"] = true,
23 ["cmake"] = true, 21 ["cmake"] = true,
diff --git a/src/luarocks/search.lua b/src/luarocks/search.lua
index 1404e303..05ae9b0e 100644
--- a/src/luarocks/search.lua
+++ b/src/luarocks/search.lua
@@ -22,12 +22,7 @@ local results = require("luarocks.results")
22 22
23 23
24 24
25
26
27
28
29function search.store_result(result_tree, result) 25function search.store_result(result_tree, result)
30 assert(type(result_tree) == "table")
31 26
32 local name = result.name 27 local name = result.name
33 local version = result.version 28 local version = result.version
diff --git a/src/luarocks/test.lua b/src/luarocks/test.lua
index 7be3d520..fbd404d7 100644
--- a/src/luarocks/test.lua
+++ b/src/luarocks/test.lua
@@ -10,8 +10,6 @@ local util = require("luarocks.util")
10 10
11 11
12 12
13
14
15local test_types = { 13local test_types = {
16 "busted", 14 "busted",
17 "command", 15 "command",
diff --git a/src/luarocks/test/busted.lua b/src/luarocks/test/busted.lua
index fc3dfe79..bc00b33a 100644
--- a/src/luarocks/test/busted.lua
+++ b/src/luarocks/test/busted.lua
@@ -7,7 +7,7 @@ local deps = require("luarocks.deps")
7local path = require("luarocks.path") 7local path = require("luarocks.path")
8local dir = require("luarocks.dir") 8local dir = require("luarocks.dir")
9local queries = require("luarocks.queries") 9local queries = require("luarocks.queries")
10 10local install = require("luarocks.cmd.install")
11 11
12 12
13 13
diff --git a/src/luarocks/test/command.lua b/src/luarocks/test/command.lua
index b7f45cef..41d30378 100644
--- a/src/luarocks/test/command.lua
+++ b/src/luarocks/test/command.lua
@@ -7,7 +7,6 @@ local cfg = require("luarocks.core.cfg")
7 7
8 8
9 9
10
11function command.detect_type() 10function command.detect_type()
12 if fs.exists("test.lua") then 11 if fs.exists("test.lua") then
13 return true 12 return true
@@ -29,7 +28,8 @@ function command.run_tests(test, args)
29 local ok 28 local ok
30 29
31 if test.script then 30 if test.script then
32 if type(test.script) ~= "string" then 31 local test_script = test.script
32 if not (type(test_script) == "string") then
33 return nil, "Malformed rockspec: 'script' expects a string" 33 return nil, "Malformed rockspec: 'script' expects a string"
34 end 34 end
35 if not fs.exists(test.script) then 35 if not fs.exists(test.script) then
@@ -38,7 +38,8 @@ function command.run_tests(test, args)
38 local lua = fs.Q(cfg.variables["LUA"]) 38 local lua = fs.Q(cfg.variables["LUA"])
39 ok = fs.execute(lua, test.script, _tl_table_unpack(args)) 39 ok = fs.execute(lua, test.script, _tl_table_unpack(args))
40 elseif test.command then 40 elseif test.command then
41 if type(test.command) ~= "string" then 41 local test_command = test.command
42 if not (type(test_command) == "string") then
42 return nil, "Malformed rockspec: 'command' expects a string" 43 return nil, "Malformed rockspec: 'command' expects a string"
43 end 44 end
44 ok = fs.execute(test.command, _tl_table_unpack(args)) 45 ok = fs.execute(test.command, _tl_table_unpack(args))
diff --git a/src/luarocks/tools/patch.lua b/src/luarocks/tools/patch.lua
index fe12244f..80dd532c 100644
--- a/src/luarocks/tools/patch.lua
+++ b/src/luarocks/tools/patch.lua
@@ -465,7 +465,7 @@ end
465 465
466local function check_patched(file, hunks) 466local function check_patched(file, hunks)
467 local lineno = 1 467 local lineno = 1
468 local ok, err = pcall(function() 468 local _, err = pcall(function()
469 if #file == 0 then 469 if #file == 0 then
470 error('nomatch', 0) 470 error('nomatch', 0)
471 end 471 end
diff --git a/src/luarocks/tools/zip.lua b/src/luarocks/tools/zip.lua
index 2b2bf0aa..5821f6d7 100644
--- a/src/luarocks/tools/zip.lua
+++ b/src/luarocks/tools/zip.lua
@@ -1,4 +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 io = _tl_compat and _tl_compat.io or io; local ipairs = _tl_compat and _tl_compat.ipairs or ipairs; local math = _tl_compat and _tl_compat.math or math; local os = _tl_compat and _tl_compat.os or os; 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 io = _tl_compat and _tl_compat.io or io; local ipairs = _tl_compat and _tl_compat.ipairs or ipairs; local math = _tl_compat and _tl_compat.math or math; local os = _tl_compat and _tl_compat.os or os; local string = _tl_compat and _tl_compat.string or string; local table = _tl_compat and _tl_compat.table or table
2 2
3 3
4local zip = {ZipHandle = {}, LocalFileHeader = {}, Zip = {}, } 4local zip = {ZipHandle = {}, LocalFileHeader = {}, Zip = {}, }
@@ -563,8 +563,6 @@ function zip.gzip(input_filename, output_filename)
563end 563end
564 564
565function zip.gunzip(input_filename, output_filename) 565function zip.gunzip(input_filename, output_filename)
566 assert(type(input_filename) == "string")
567 assert(output_filename == nil or type(output_filename) == "string")
568 566
569 if not output_filename then 567 if not output_filename then
570 output_filename = input_filename:gsub("%.gz$", "") 568 output_filename = input_filename:gsub("%.gz$", "")
diff --git a/src/luarocks/type/manifest.lua b/src/luarocks/type/manifest.lua
index 8b0396ef..3f3be728 100644
--- a/src/luarocks/type/manifest.lua
+++ b/src/luarocks/type/manifest.lua
@@ -1,6 +1,8 @@
1local type_manifest = {} 1local type_manifest = {}
2 2
3 3
4
5
4local type_check = require("luarocks.type_check") 6local type_check = require("luarocks.type_check")
5 7
6local manifest_formats = type_check.declare_schemas({ 8local manifest_formats = type_check.declare_schemas({
diff --git a/src/luarocks/type/rockspec.lua b/src/luarocks/type/rockspec.lua
index caa99ec1..cd4044f6 100644
--- a/src/luarocks/type/rockspec.lua
+++ b/src/luarocks/type/rockspec.lua
@@ -7,8 +7,6 @@ local _tl_compat; if (tonumber((_VERSION or ''):match('[%d.]*$')) or 0) < 5.3 th
7 7
8 8
9 9
10
11
12local type_check = require("luarocks.type_check") 10local type_check = require("luarocks.type_check")
13 11
14 12
diff --git a/src/luarocks/upload/api.lua b/src/luarocks/upload/api.lua
index 457e45f5..f3646708 100644
--- a/src/luarocks/upload/api.lua
+++ b/src/luarocks/upload/api.lua
@@ -1,11 +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 io = _tl_compat and _tl_compat.io or io; local os = _tl_compat and _tl_compat.os or os; local package = _tl_compat and _tl_compat.package or package; local pairs = _tl_compat and _tl_compat.pairs or pairs; local pcall = _tl_compat and _tl_compat.pcall or pcall; local string = _tl_compat and _tl_compat.string or string; local table = _tl_compat and _tl_compat.table or table; local api = {Configuration = {}, Api = {}, Args = {}, } 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 io = _tl_compat and _tl_compat.io or io; local os = _tl_compat and _tl_compat.os or os; local package = _tl_compat and _tl_compat.package or package; local pairs = _tl_compat and _tl_compat.pairs or pairs; local pcall = _tl_compat and _tl_compat.pcall or pcall; local string = _tl_compat and _tl_compat.string or string; local table = _tl_compat and _tl_compat.table or table; local api = {Configuration = {}, Api = {}, }
2
3
4
5
6
7
8
9 2
10 3
11 4
@@ -35,6 +28,8 @@ local Api = api.Api
35 28
36 29
37 30
31
32
38local function upload_config_file() 33local function upload_config_file()
39 if not cfg.config_files.user.file then 34 if not cfg.config_files.user.file then
40 return nil 35 return nil
diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua
index 2c8d8ca6..79430110 100644
--- a/src/luarocks/util.lua
+++ b/src/luarocks/util.lua
@@ -7,10 +7,11 @@ local _tl_compat; if (tonumber((_VERSION or ''):match('[%d.]*$')) or 0) < 5.3 th
7local core = require("luarocks.core.util") 7local core = require("luarocks.core.util")
8local cfg = require("luarocks.core.cfg") 8local cfg = require("luarocks.core.cfg")
9 9
10local util = {Fn = {}, Parser = {}, }
11 10
12 11
13 12
13local util = {Fn = {}, Parser = {}, }
14
14 15
15 16
16 17
@@ -51,6 +52,8 @@ util.matchquote = core.matchquote
51 52
52 53
53 54
55local argparse = require("luarocks.vendor.argparse")
56
54 57
55 58
56local scheduled_functions = {} 59local scheduled_functions = {}