diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2021-03-16 13:53:38 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2021-03-19 13:15:53 -0300 |
commit | 08ae98e309c3f09be00b547bab74a5fd875bfa36 (patch) | |
tree | 5a60ebe5bad6c726bd6fbd0eed195a2a6fffd094 | |
parent | df45eed77cc26bc91c1917e3409d0599f78a2aed (diff) | |
download | luarocks-08ae98e309c3f09be00b547bab74a5fd875bfa36.tar.gz luarocks-08ae98e309c3f09be00b547bab74a5fd875bfa36.tar.bz2 luarocks-08ae98e309c3f09be00b547bab74a5fd875bfa36.zip |
repos.delete_version: remove entry from manifest if rock is already missing
If rock_manifest could not be found, the entry in manifest is unusable:
without the list of files from rock_manifest, we can't scan the repository
to remove files. This means the entry in the repo manifest is a leftover from
an incomplete removal. Remove the entry from the repo manifest.
-rw-r--r-- | src/luarocks/repos.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/luarocks/repos.lua b/src/luarocks/repos.lua index 4610c734..8eecf8fd 100644 --- a/src/luarocks/repos.lua +++ b/src/luarocks/repos.lua | |||
@@ -523,7 +523,14 @@ function repos.delete_version(name, version, deps_mode, quick) | |||
523 | assert(type(deps_mode) == "string") | 523 | assert(type(deps_mode) == "string") |
524 | 524 | ||
525 | local rock_manifest, load_err = manif.load_rock_manifest(name, version) | 525 | local rock_manifest, load_err = manif.load_rock_manifest(name, version) |
526 | if not rock_manifest then return nil, load_err end | 526 | if not rock_manifest then |
527 | if not quick then | ||
528 | local writer = require("luarocks.manif.writer") | ||
529 | writer.remove_from_manifest(name, version, nil, deps_mode) | ||
530 | return nil, "rock_manifest file not found for "..name.." "..version.." - removed entry from the manifest" | ||
531 | end | ||
532 | return nil, load_err | ||
533 | end | ||
527 | 534 | ||
528 | local repo = cfg.root_dir | 535 | local repo = cfg.root_dir |
529 | local renames = {} | 536 | local renames = {} |