aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-08-02 13:48:01 -0300
committerHisham Muhammad <hisham@gobolinux.org>2018-08-02 13:50:01 -0300
commit1ab3297faae3e57772c840d74828a9d370a6cd84 (patch)
treedfa3e5cad3e4ac1f20c77db59f951bc0b55e2e2b /src
parentdcaf10c26714cbc518cbf329d0fb7b71d4241494 (diff)
downloadluarocks-1ab3297faae3e57772c840d74828a9d370a6cd84.tar.gz
luarocks-1ab3297faae3e57772c840d74828a9d370a6cd84.tar.bz2
luarocks-1ab3297faae3e57772c840d74828a9d370a6cd84.zip
Fix: do not detect .luarocks/config-5.x.lua and lua_modules as modules
Running luarocks init a second time after deleting the rockspec was mis-detects .luarocks/config-5.x.lua as a module, creating an entry `["luarocks.config-5.3"] = ".luarocks/config-5.3.lua"` in `build.modules`. Same problem happened with modules under `lua_modules`. This excludes `.luarocks` and `lua_modules` from module detection. Includes a regression test. Closes #847.
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/build/builtin.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua
index 694542ba..2db6f256 100644
--- a/src/luarocks/build/builtin.lua
+++ b/src/luarocks/build/builtin.lua
@@ -89,7 +89,9 @@ do
89 89
90 for _, file in ipairs(fs.find()) do 90 for _, file in ipairs(fs.find()) do
91 local luamod = file:match("(.*)%.lua$") 91 local luamod = file:match("(.*)%.lua$")
92 if luamod and not luamod_blacklist[luamod] then 92 if file:match("^.luarocks") or file:match("^lua_modules") then
93 -- skip
94 elseif luamod and not luamod_blacklist[luamod] then
93 modules[path.path_to_module(file)] = prefix..file 95 modules[path.path_to_module(file)] = prefix..file
94 else 96 else
95 local cmod = file:match("(.*)%.c$") 97 local cmod = file:match("(.*)%.c$")