aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham <hisham@gobolinux.org>2016-10-29 16:14:05 -0200
committerHisham <hisham@gobolinux.org>2016-10-29 16:14:05 -0200
commit67f73b4a1a18a6ff9535ac4ed5faec0d1eb9671a (patch)
treeb28b633631c411d198e6393f54cb4d3622a6ee22
parentdb7814136e3ce45141d3582738dc36ad3596df2c (diff)
downloadluarocks-67f73b4a1a18a6ff9535ac4ed5faec0d1eb9671a.tar.gz
luarocks-67f73b4a1a18a6ff9535ac4ed5faec0d1eb9671a.tar.bz2
luarocks-67f73b4a1a18a6ff9535ac4ed5faec0d1eb9671a.zip
Move admin commands to luarocks.admin.cmd.*; fix references to modules.
-rwxr-xr-xsrc/bin/luarocks38
-rwxr-xr-xsrc/bin/luarocks-admin10
-rw-r--r--src/luarocks/admin/cmd/add.lua (renamed from src/luarocks/admin/add.lua)0
-rw-r--r--src/luarocks/admin/cmd/make_manifest.lua (renamed from src/luarocks/admin/make_manifest.lua)0
-rw-r--r--src/luarocks/admin/cmd/refresh_cache.lua (renamed from src/luarocks/admin/refresh_cache.lua)0
-rw-r--r--src/luarocks/admin/cmd/remove.lua (renamed from src/luarocks/admin/remove.lua)0
-rw-r--r--src/luarocks/cmd/install.lua4
-rw-r--r--src/luarocks/cmd/search.lua13
-rw-r--r--src/luarocks/deps.lua2
-rw-r--r--src/luarocks/download.lua4
10 files changed, 36 insertions, 35 deletions
diff --git a/src/bin/luarocks b/src/bin/luarocks
index 21f17da9..88a1d1ca 100755
--- a/src/bin/luarocks
+++ b/src/bin/luarocks
@@ -9,25 +9,25 @@ local command_line = require("luarocks.command_line")
9program_description = "LuaRocks main command-line interface" 9program_description = "LuaRocks main command-line interface"
10 10
11commands = { 11commands = {
12 help = "luarocks.help", 12 help = "luarocks.cmd.help",
13 pack = "luarocks.pack", 13 pack = "luarocks.cmd.pack",
14 unpack = "luarocks.unpack", 14 unpack = "luarocks.cmd.unpack",
15 build = "luarocks.build", 15 build = "luarocks.cmd.build",
16 install = "luarocks.install", 16 install = "luarocks.cmd.install",
17 search = "luarocks.search", 17 search = "luarocks.cmd.search",
18 list = "luarocks.list", 18 list = "luarocks.cmd.list",
19 remove = "luarocks.remove", 19 remove = "luarocks.cmd.remove",
20 make = "luarocks.make", 20 make = "luarocks.cmd.make",
21 download = "luarocks.download", 21 download = "luarocks.cmd.download",
22 path = "luarocks.path_cmd", 22 path = "luarocks.cmd.path",
23 show = "luarocks.show", 23 show = "luarocks.cmd.show",
24 new_version = "luarocks.new_version", 24 new_version = "luarocks.cmd.new_version",
25 lint = "luarocks.lint", 25 lint = "luarocks.cmd.lint",
26 write_rockspec = "luarocks.write_rockspec", 26 write_rockspec = "luarocks.cmd.write_rockspec",
27 purge = "luarocks.purge", 27 purge = "luarocks.cmd.purge",
28 doc = "luarocks.doc", 28 doc = "luarocks.cmd.doc",
29 upload = "luarocks.upload", 29 upload = "luarocks.cmd.upload",
30 config = "luarocks.config_cmd", 30 config = "luarocks.cmd.config",
31} 31}
32 32
33command_line.run_command(...) 33command_line.run_command(...)
diff --git a/src/bin/luarocks-admin b/src/bin/luarocks-admin
index 660c0a70..5db24640 100755
--- a/src/bin/luarocks-admin
+++ b/src/bin/luarocks-admin
@@ -9,11 +9,11 @@ local command_line = require("luarocks.command_line")
9program_description = "LuaRocks repository administration interface" 9program_description = "LuaRocks repository administration interface"
10 10
11commands = { 11commands = {
12 help = "luarocks.help", 12 help = "luarocks.cmd.help",
13 make_manifest = "luarocks.admin.make_manifest", 13 make_manifest = "luarocks.admin.cmd.make_manifest",
14 add = "luarocks.admin.add", 14 add = "luarocks.admin.cmd.add",
15 remove = "luarocks.admin.remove", 15 remove = "luarocks.admin.cmd.remove",
16 refresh_cache = "luarocks.admin.refresh_cache", 16 refresh_cache = "luarocks.admin.cmd.refresh_cache",
17} 17}
18 18
19command_line.run_command(...) 19command_line.run_command(...)
diff --git a/src/luarocks/admin/add.lua b/src/luarocks/admin/cmd/add.lua
index daf46c1d..daf46c1d 100644
--- a/src/luarocks/admin/add.lua
+++ b/src/luarocks/admin/cmd/add.lua
diff --git a/src/luarocks/admin/make_manifest.lua b/src/luarocks/admin/cmd/make_manifest.lua
index 57851942..57851942 100644
--- a/src/luarocks/admin/make_manifest.lua
+++ b/src/luarocks/admin/cmd/make_manifest.lua
diff --git a/src/luarocks/admin/refresh_cache.lua b/src/luarocks/admin/cmd/refresh_cache.lua
index 947dbfb0..947dbfb0 100644
--- a/src/luarocks/admin/refresh_cache.lua
+++ b/src/luarocks/admin/cmd/refresh_cache.lua
diff --git a/src/luarocks/admin/remove.lua b/src/luarocks/admin/cmd/remove.lua
index 763a166f..763a166f 100644
--- a/src/luarocks/admin/remove.lua
+++ b/src/luarocks/admin/cmd/remove.lua
diff --git a/src/luarocks/cmd/install.lua b/src/luarocks/cmd/install.lua
index c9b085f5..33cc8fbf 100644
--- a/src/luarocks/cmd/install.lua
+++ b/src/luarocks/cmd/install.lua
@@ -10,6 +10,7 @@ local fs = require("luarocks.fs")
10local deps = require("luarocks.deps") 10local deps = require("luarocks.deps")
11local writer = require("luarocks.manif.writer") 11local writer = require("luarocks.manif.writer")
12local remove = require("luarocks.remove") 12local remove = require("luarocks.remove")
13local search = require("luarocks.search")
13local cfg = require("luarocks.core.cfg") 14local cfg = require("luarocks.core.cfg")
14 15
15install.help_summary = "Install a rock." 16install.help_summary = "Install a rock."
@@ -154,7 +155,7 @@ function install.command(flags, name, version)
154 if not ok then return nil, err, cfg.errorcodes.PERMISSIONDENIED end 155 if not ok then return nil, err, cfg.errorcodes.PERMISSIONDENIED end
155 156
156 if name:match("%.rockspec$") or name:match("%.src%.rock$") then 157 if name:match("%.rockspec$") or name:match("%.src%.rock$") then
157 local build = require("luarocks.build") 158 local build = require("luarocks.cmd.build")
158 return build.command(flags, name) 159 return build.command(flags, name)
159 elseif name:match("%.rock$") then 160 elseif name:match("%.rock$") then
160 if flags["only-deps"] then 161 if flags["only-deps"] then
@@ -170,7 +171,6 @@ function install.command(flags, name, version)
170 end 171 end
171 return name, version 172 return name, version
172 else 173 else
173 local search = require("luarocks.search")
174 local url, err = search.find_suitable_rock(search.make_query(name:lower(), version)) 174 local url, err = search.find_suitable_rock(search.make_query(name:lower(), version))
175 if not url then 175 if not url then
176 return nil, err 176 return nil, err
diff --git a/src/luarocks/cmd/search.lua b/src/luarocks/cmd/search.lua
index 109fe805..c4e4058d 100644
--- a/src/luarocks/cmd/search.lua
+++ b/src/luarocks/cmd/search.lua
@@ -1,14 +1,15 @@
1 1
2--- Module implementing the LuaRocks "search" command. 2--- Module implementing the LuaRocks "search" command.
3-- Queries LuaRocks servers. 3-- Queries LuaRocks servers.
4local search = {} 4local cmd_search = {}
5 5
6local cfg = require("luarocks.core.cfg") 6local cfg = require("luarocks.core.cfg")
7local util = require("luarocks.util") 7local util = require("luarocks.util")
8local search = require("luarocks.search")
8 9
9search.help_summary = "Query the LuaRocks servers." 10cmd_search.help_summary = "Query the LuaRocks servers."
10search.help_arguments = "[--source] [--binary] { <name> [<version>] | --all }" 11cmd_search.help_arguments = "[--source] [--binary] { <name> [<version>] | --all }"
11search.help = [[ 12cmd_search.help = [[
12--source Return only rockspecs and source rocks, 13--source Return only rockspecs and source rocks,
13 to be used with the "build" command. 14 to be used with the "build" command.
14--binary Return only pure Lua and binary rocks (rocks that can be used 15--binary Return only pure Lua and binary rocks (rocks that can be used
@@ -44,7 +45,7 @@ end
44-- @param version string or nil: a version may also be passed. 45-- @param version string or nil: a version may also be passed.
45-- @return boolean or (nil, string): True if build was successful; nil and an 46-- @return boolean or (nil, string): True if build was successful; nil and an
46-- error message otherwise. 47-- error message otherwise.
47function search.command(flags, name, version) 48function cmd_search.command(flags, name, version)
48 if flags["all"] then 49 if flags["all"] then
49 name, version = "", nil 50 name, version = "", nil
50 end 51 end
@@ -70,4 +71,4 @@ function search.command(flags, name, version)
70 return true 71 return true
71end 72end
72 73
73return search 74return cmd_search
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua
index acbf1dd6..081265a5 100644
--- a/src/luarocks/deps.lua
+++ b/src/luarocks/deps.lua
@@ -240,7 +240,7 @@ end
240function deps.fulfill_dependencies(rockspec, deps_mode) 240function deps.fulfill_dependencies(rockspec, deps_mode)
241 241
242 local search = require("luarocks.search") 242 local search = require("luarocks.search")
243 local install = require("luarocks.install") 243 local install = require("luarocks.cmd.install")
244 244
245 if rockspec.supported_platforms then 245 if rockspec.supported_platforms then
246 if not deps.platforms_set then 246 if not deps.platforms_set then
diff --git a/src/luarocks/download.lua b/src/luarocks/download.lua
index c0f2678f..ec9996b2 100644
--- a/src/luarocks/download.lua
+++ b/src/luarocks/download.lua
@@ -32,8 +32,8 @@ function download.download(arch, name, version, all)
32 local has_result = false 32 local has_result = false
33 local all_ok = true 33 local all_ok = true
34 local any_err = "" 34 local any_err = ""
35 for _, result in pairs(results) do 35 for name, result in pairs(results) do
36 for _, items in pairs(result) do 36 for version, items in pairs(result) do
37 for _, item in ipairs(items) do 37 for _, item in ipairs(items) do
38 -- Ignore provided rocks. 38 -- Ignore provided rocks.
39 if item.arch ~= "installed" then 39 if item.arch ~= "installed" then