diff options
author | mpeterv <mpeterval@gmail.com> | 2015-12-19 19:22:37 +0300 |
---|---|---|
committer | mpeterv <mpeterval@gmail.com> | 2015-12-19 19:22:37 +0300 |
commit | 908e4ba7f0d09fafb35272e021605404261f4432 (patch) | |
tree | 7c563289dfde36e9592b3156feaee8cd0422b1aa /src | |
parent | fbe0915c8e5a59267decde4a538145ae62fb5869 (diff) | |
download | luarocks-908e4ba7f0d09fafb35272e021605404261f4432.tar.gz luarocks-908e4ba7f0d09fafb35272e021605404261f4432.tar.bz2 luarocks-908e4ba7f0d09fafb35272e021605404261f4432.zip |
Fix extension splitting in builting backend
Fixes incorrect gcc command and error message when a file name
doesn't contain a dot:
Error: Build error: Failed compiling object .o
becomes
Error: Build error: Failed compiling object dotlessname
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/build/builtin.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua index 00fd09ea..ffdc9450 100644 --- a/src/luarocks/build/builtin.lua +++ b/src/luarocks/build/builtin.lua | |||
@@ -202,7 +202,7 @@ function builtin.run(rockspec) | |||
202 | for name, info in pairs(build.modules) do | 202 | for name, info in pairs(build.modules) do |
203 | local moddir = path.module_to_path(name) | 203 | local moddir = path.module_to_path(name) |
204 | if type(info) == "string" then | 204 | if type(info) == "string" then |
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 info:match("init%.lua$") and not name:match("%.init$") then |
@@ -226,7 +226,7 @@ function builtin.run(rockspec) | |||
226 | if info[1] then sources = info end | 226 | if info[1] then sources = info end |
227 | if type(sources) == "string" then sources = {sources} end | 227 | if type(sources) == "string" then sources = {sources} end |
228 | for _, source in ipairs(sources) do | 228 | for _, source in ipairs(sources) do |
229 | local object = source:gsub(".[^.]*$", "."..cfg.obj_extension) | 229 | local object = source:gsub("%.[^.]*$", "."..cfg.obj_extension) |
230 | if not object then | 230 | if not object then |
231 | object = source.."."..cfg.obj_extension | 231 | object = source.."."..cfg.obj_extension |
232 | end | 232 | end |