From 08ae98e309c3f09be00b547bab74a5fd875bfa36 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 16 Mar 2021 13:53:38 -0300 Subject: 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. --- src/luarocks/repos.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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) assert(type(deps_mode) == "string") local rock_manifest, load_err = manif.load_rock_manifest(name, version) - if not rock_manifest then return nil, load_err end + if not rock_manifest then + if not quick then + local writer = require("luarocks.manif.writer") + writer.remove_from_manifest(name, version, nil, deps_mode) + return nil, "rock_manifest file not found for "..name.." "..version.." - removed entry from the manifest" + end + return nil, load_err + end local repo = cfg.root_dir local renames = {} -- cgit v1.2.3-55-g6feb