diff options
author | Peter Melnichenko <mpeterval@gmail.com> | 2016-10-19 17:59:36 +0300 |
---|---|---|
committer | Peter Melnichenko <mpeterval@gmail.com> | 2016-10-19 17:59:36 +0300 |
commit | 2bfcd954d1b7c94983ea3e25ac1cf44f304d9505 (patch) | |
tree | b8a362d450bd935a450fead7803fa5cdbc9dfd2e /src | |
parent | 66390224e272b0cbda12e50042209dafd1222dc0 (diff) | |
download | luarocks-2bfcd954d1b7c94983ea3e25ac1cf44f304d9505.tar.gz luarocks-2bfcd954d1b7c94983ea3e25ac1cf44f304d9505.tar.bz2 luarocks-2bfcd954d1b7c94983ea3e25ac1cf44f304d9505.zip |
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`.
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/build/builtin.lua | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
205 | local ext = info:match("%.([^.]+)$") | 205 | local ext = info:match("%.([^.]+)$") |
206 | if ext == "lua" then | 206 | if ext == "lua" then |
207 | local filename = dir.base_name(info) | 207 | local filename = dir.base_name(info) |
208 | if info:match("init%.lua$") and not name:match("%.init$") then | 208 | if filename == "init.lua" and not name:match("%.init$") then |
209 | moddir = path.module_to_path(name..".init") | 209 | moddir = path.module_to_path(name..".init") |
210 | else | 210 | else |
211 | local basename = name:match("([^.]+)$") | 211 | local basename = name:match("([^.]+)$") |