From 1a7f921e4cf1d4023340a8ba4dde17cb3e6bd311 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 7 Feb 2020 10:42:50 +0100 Subject: fix downgrades of rocks containing directories (#1151) Fixes #1141 --- src/luarocks/repos.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/luarocks/repos.lua b/src/luarocks/repos.lua index e9dddc7c..b2a7d81a 100644 --- a/src/luarocks/repos.lua +++ b/src/luarocks/repos.lua @@ -272,7 +272,7 @@ local function backup_existing(should_backup, target) until not fs.exists(backup) -- Slight race condition here, but shouldn't be a problem. util.warning(target.." is not tracked by this installation of LuaRocks. Moving it to "..backup) - local move_ok, move_err = fs.move(target, backup) + local move_ok, move_err = os.rename(target, backup) if not move_ok then return nil, move_err end @@ -331,7 +331,7 @@ end local function rollback_install(op) fs.delete(op.dst) if op.backup_file then - fs.move(op.backup_file, op.dst) + os.rename(op.backup_file, op.dst) end fs.remove_dir_tree_if_empty(dir.dir_name(op.dst)) return true @@ -347,7 +347,7 @@ local function op_rename(op) if fs.exists(op.src) then fs.make_dir(dir.dir_name(op.dst)) fs.delete(op.dst) - local ok, err = fs.move(op.src, op.dst) + local ok, err = os.rename(op.src, op.dst) fs.remove_dir_tree_if_empty(dir.dir_name(op.src)) return ok, err else -- cgit v1.2.3-55-g6feb