aboutsummaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorHisham <hisham@gobolinux.org>2016-06-30 01:15:01 -0300
committerHisham <hisham@gobolinux.org>2016-06-30 01:15:01 -0300
commitf2beb5ee1fd2c54d59a43f4f2a8fe0f7a1701daa (patch)
tree46f958aa7efb4d6b31612178026228ba49e612f5 /src/bin
parent6b38323d10743c83e377d9be2fa734a3a3d5a300 (diff)
downloadluarocks-f2beb5ee1fd2c54d59a43f4f2a8fe0f7a1701daa.tar.gz
luarocks-f2beb5ee1fd2c54d59a43f4f2a8fe0f7a1701daa.tar.bz2
luarocks-f2beb5ee1fd2c54d59a43f4f2a8fe0f7a1701daa.zip
Core modules reorganization.
Isolate all modules used by luarocks.loader in a luarocks.core.* namespace. Core modules can only require other core modules, and they only use require() at the top-level chunk. In other words, after luarocks.loader is setup, package.path can be altered at will and it should not affect the ability of luarocks.loader to run, and the luarocks.loader modules should not interfere with modules loaded later. This was motivated by @robooo's GSoC work on porting the LuaRocks test suite to Lua using Busted. Busted itself runs using luarocks.loader, and we need to ensure that the modules loaded by the tests do not conflict with the ones used by luarocks.loader. A circular dependency between luarocks.manif and luarocks.search was removed by creating a separate luarocks.manif.writer module. Also, luarocks-admin commands were moved to a luarocks.admin.* namespace.
Diffstat (limited to 'src/bin')
-rwxr-xr-xsrc/bin/luarocks2
-rwxr-xr-xsrc/bin/luarocks-admin10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/bin/luarocks b/src/bin/luarocks
index be6c2b81..21f17da9 100755
--- a/src/bin/luarocks
+++ b/src/bin/luarocks
@@ -1,7 +1,7 @@
1#!/usr/bin/env lua 1#!/usr/bin/env lua
2 2
3-- this should be loaded first. 3-- this should be loaded first.
4local cfg = require("luarocks.cfg") 4local cfg = require("luarocks.core.cfg")
5 5
6local loader = require("luarocks.loader") 6local loader = require("luarocks.loader")
7local command_line = require("luarocks.command_line") 7local command_line = require("luarocks.command_line")
diff --git a/src/bin/luarocks-admin b/src/bin/luarocks-admin
index 2890d1f1..660c0a70 100755
--- a/src/bin/luarocks-admin
+++ b/src/bin/luarocks-admin
@@ -1,7 +1,7 @@
1#!/usr/bin/env lua 1#!/usr/bin/env lua
2 2
3-- this should be loaded first. 3-- this should be loaded first.
4local cfg = require("luarocks.cfg") 4local cfg = require("luarocks.core.cfg")
5 5
6local loader = require("luarocks.loader") 6local loader = require("luarocks.loader")
7local command_line = require("luarocks.command_line") 7local command_line = require("luarocks.command_line")
@@ -10,10 +10,10 @@ program_description = "LuaRocks repository administration interface"
10 10
11commands = { 11commands = {
12 help = "luarocks.help", 12 help = "luarocks.help",
13 make_manifest = "luarocks.make_manifest", 13 make_manifest = "luarocks.admin.make_manifest",
14 add = "luarocks.add", 14 add = "luarocks.admin.add",
15 remove = "luarocks.admin_remove", 15 remove = "luarocks.admin.remove",
16 refresh_cache = "luarocks.refresh_cache", 16 refresh_cache = "luarocks.admin.refresh_cache",
17} 17}
18 18
19command_line.run_command(...) 19command_line.run_command(...)