aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/build_spec.lua2
-rw-r--r--src/luarocks/fs/lua.lua3
2 files changed, 4 insertions, 1 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua
index 707ab145..62fbb353 100644
--- a/spec/build_spec.lua
+++ b/spec/build_spec.lua
@@ -322,7 +322,7 @@ describe("LuaRocks build tests #integration", function()
322 lfs.rmdir(tmpdir) 322 lfs.rmdir(tmpdir)
323 end) 323 end)
324 324
325 pending("LuaRocks build only deps of a given rock", function() 325 it("LuaRocks build only deps of a given rock", function()
326 local olddir = lfs.currentdir() 326 local olddir = lfs.currentdir()
327 local tmpdir = get_tmp_path() 327 local tmpdir = get_tmp_path()
328 lfs.mkdir(tmpdir) 328 lfs.mkdir(tmpdir)
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua
index 375cdee3..74d8f12f 100644
--- a/src/luarocks/fs/lua.lua
+++ b/src/luarocks/fs/lua.lua
@@ -376,6 +376,9 @@ function fs_lua.copy(src, dest, perms)
376 if destmode == "directory" then 376 if destmode == "directory" then
377 dest = dir.path(dest, dir.base_name(src)) 377 dest = dir.path(dest, dir.base_name(src))
378 end 378 end
379 if src == dest or (cfg.is_platform("unix") and lfs.attributes(src, "ino") == lfs.attributes(dest, "ino")) then
380 return nil, "The source and destination are the same files"
381 end
379 local src_h, err = io.open(src, "rb") 382 local src_h, err = io.open(src, "rb")
380 if not src_h then return nil, err end 383 if not src_h then return nil, err end
381 local dest_h, err = io.open(dest, "w+b") 384 local dest_h, err = io.open(dest, "w+b")