From 2bfcd954d1b7c94983ea3e25ac1cf44f304d9505 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Wed, 19 Oct 2016 17:59:36 +0300 Subject: Fix installation of modules from files ending with "init.lua" In builtin backend, when figuring out where to install a module and checking for special "init.lua" logic, trigger it only when the whole basename is "init.lua", not when it merely ends with it. Fixes incorrect installation when build.modules contains pairs like `["kainit"] = "kainit.lua"` - the module used to go to `kainit/kainit.lua` instead of just `kainit.lua`. --- src/luarocks/build/builtin.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua index c8b1b84d..6719be81 100644 --- a/src/luarocks/build/builtin.lua +++ b/src/luarocks/build/builtin.lua @@ -205,7 +205,7 @@ function builtin.run(rockspec) local ext = info:match("%.([^.]+)$") if ext == "lua" then local filename = dir.base_name(info) - if info:match("init%.lua$") and not name:match("%.init$") then + if filename == "init.lua" and not name:match("%.init$") then moddir = path.module_to_path(name..".init") else local basename = name:match("([^.]+)$") -- cgit v1.2.3-55-g6feb