diff options
-rw-r--r-- | src/luarocks/build/builtin.lua | 33 | ||||
-rw-r--r-- | src/luarocks/fs/win32/tools.lua | 3 |
2 files changed, 13 insertions, 23 deletions
diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua index 3d179b34..9d97d58b 100644 --- a/src/luarocks/build/builtin.lua +++ b/src/luarocks/build/builtin.lua | |||
@@ -217,8 +217,7 @@ function run(rockspec) | |||
217 | end | 217 | end |
218 | ok = compile_object(object, source, info.defines, info.incdirs) | 218 | ok = compile_object(object, source, info.defines, info.incdirs) |
219 | if not ok then | 219 | if not ok then |
220 | err = "Failed compiling object "..object | 220 | return nil, "Failed compiling object "..object |
221 | break | ||
222 | end | 221 | end |
223 | table.insert(objects, object) | 222 | table.insert(objects, object) |
224 | end | 223 | end |
@@ -231,30 +230,22 @@ function run(rockspec) | |||
231 | built_modules[module_name] = dest | 230 | built_modules[module_name] = dest |
232 | ok = compile_library(module_name, objects, info.libraries, info.libdirs, name) | 231 | ok = compile_library(module_name, objects, info.libraries, info.libdirs, name) |
233 | if not ok then | 232 | if not ok then |
234 | err = "Failed compiling module "..module_name | 233 | return nil, "Failed compiling module "..module_name |
235 | break | ||
236 | end | 234 | end |
237 | end | 235 | end |
238 | end | 236 | end |
239 | if ok then | 237 | for name, dest in pairs(built_modules) do |
240 | for name, dest in pairs(built_modules) do | 238 | fs.make_dir(dest) |
241 | fs.make_dir(dest) | 239 | ok = fs.copy(name, dest) |
242 | ok = fs.copy(name, dest) | 240 | if not ok then |
243 | if not ok then | 241 | return nil, "Failed installing "..name.." in "..dest |
244 | err = "Failed installing "..name.." in "..dest | ||
245 | break | ||
246 | end | ||
247 | end | 242 | end |
248 | end | 243 | end |
249 | if ok then | 244 | if fs.is_dir("lua") then |
250 | if fs.is_dir("lua") then | 245 | ok, err = fs.copy_contents("lua", luadir) |
251 | ok, err = fs.copy_contents("lua", luadir) | 246 | if not ok then |
252 | if not ok then err = "Failed copying contents of 'lua' directory: "..err end | 247 | return nil, "Failed copying contents of 'lua' directory: "..err |
253 | end | 248 | end |
254 | end | 249 | end |
255 | if ok then | 250 | return true |
256 | return true | ||
257 | else | ||
258 | return nil, err | ||
259 | end | ||
260 | end | 251 | end |
diff --git a/src/luarocks/fs/win32/tools.lua b/src/luarocks/fs/win32/tools.lua index c563b137..033f71be 100644 --- a/src/luarocks/fs/win32/tools.lua +++ b/src/luarocks/fs/win32/tools.lua | |||
@@ -146,8 +146,7 @@ end | |||
146 | -- plus an error message. | 146 | -- plus an error message. |
147 | function copy_contents(src, dest) | 147 | function copy_contents(src, dest) |
148 | assert(src and dest) | 148 | assert(src and dest) |
149 | if fs.execute_string(fs.quiet("xcopy "..src.."\\*.* "..fs.Q(dest).." /S/E/Y")) then | 149 | if fs.execute_string(fs.quiet(vars.CP.." -a "..src.."\\*.* "..fs.Q(dest))) then |
150 | --if fs.execute_string(fs.quiet(vars.CP.." -a "..src.."\\*.* "..fs.Q(dest))) then | ||
151 | return true | 150 | return true |
152 | else | 151 | else |
153 | return false, "Failed copying "..src.." to "..dest | 152 | return false, "Failed copying "..src.." to "..dest |