diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2020-02-07 10:42:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-07 10:42:50 +0100 |
| commit | 1a7f921e4cf1d4023340a8ba4dde17cb3e6bd311 (patch) | |
| tree | 1c56d34fe38719bd41815c914c53294e5e4bb3e0 /src | |
| parent | 201ac63c7692355b07b83034c1813c000ec70e84 (diff) | |
| download | luarocks-1a7f921e4cf1d4023340a8ba4dde17cb3e6bd311.tar.gz luarocks-1a7f921e4cf1d4023340a8ba4dde17cb3e6bd311.tar.bz2 luarocks-1a7f921e4cf1d4023340a8ba4dde17cb3e6bd311.zip | |
fix downgrades of rocks containing directories (#1151)
Fixes #1141
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/repos.lua | 6 |
1 files changed, 3 insertions, 3 deletions
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) | |||
| 272 | until not fs.exists(backup) -- Slight race condition here, but shouldn't be a problem. | 272 | until not fs.exists(backup) -- Slight race condition here, but shouldn't be a problem. |
| 273 | 273 | ||
| 274 | util.warning(target.." is not tracked by this installation of LuaRocks. Moving it to "..backup) | 274 | util.warning(target.." is not tracked by this installation of LuaRocks. Moving it to "..backup) |
| 275 | local move_ok, move_err = fs.move(target, backup) | 275 | local move_ok, move_err = os.rename(target, backup) |
| 276 | if not move_ok then | 276 | if not move_ok then |
| 277 | return nil, move_err | 277 | return nil, move_err |
| 278 | end | 278 | end |
| @@ -331,7 +331,7 @@ end | |||
| 331 | local function rollback_install(op) | 331 | local function rollback_install(op) |
| 332 | fs.delete(op.dst) | 332 | fs.delete(op.dst) |
| 333 | if op.backup_file then | 333 | if op.backup_file then |
| 334 | fs.move(op.backup_file, op.dst) | 334 | os.rename(op.backup_file, op.dst) |
| 335 | end | 335 | end |
| 336 | fs.remove_dir_tree_if_empty(dir.dir_name(op.dst)) | 336 | fs.remove_dir_tree_if_empty(dir.dir_name(op.dst)) |
| 337 | return true | 337 | return true |
| @@ -347,7 +347,7 @@ local function op_rename(op) | |||
| 347 | if fs.exists(op.src) then | 347 | if fs.exists(op.src) then |
| 348 | fs.make_dir(dir.dir_name(op.dst)) | 348 | fs.make_dir(dir.dir_name(op.dst)) |
| 349 | fs.delete(op.dst) | 349 | fs.delete(op.dst) |
| 350 | local ok, err = fs.move(op.src, op.dst) | 350 | local ok, err = os.rename(op.src, op.dst) |
| 351 | fs.remove_dir_tree_if_empty(dir.dir_name(op.src)) | 351 | fs.remove_dir_tree_if_empty(dir.dir_name(op.src)) |
| 352 | return ok, err | 352 | return ok, err |
| 353 | else | 353 | else |
