From 28723ac33ccc22d62877f893927a561b7fb1ecbf Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 16 Mar 2021 14:56:33 -0300 Subject: repos: search for "foo" in manifest when processing "foo.init" Older versions of LuaRocks (< 3) registered "foo.init" files as "foo" (which caused problems, so that behavior was changed). But look for that in the manifest anyway for backward compatibility. See https://github.com/luarocks/luarocks/commit/65c417e0ecda55f44c691df032163a8c08f0b52a See #1276. --- src/luarocks/repos.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/luarocks/repos.lua b/src/luarocks/repos.lua index 6827cd0f..af1daf9e 100644 --- a/src/luarocks/repos.lua +++ b/src/luarocks/repos.lua @@ -248,6 +248,14 @@ end local function check_spot_if_available(name, version, deploy_type, file_path) local item_type, item_name = get_provided_item(deploy_type, file_path) local cur_name, cur_version = manif.get_current_provider(item_type, item_name) + + -- older versions of LuaRocks (< 3) registered "foo.init" files as "foo" + -- (which caused problems, so that behavior was changed). But look for that + -- in the manifest anyway for backward compatibility. + if not cur_name and deploy_type == "lua" and item_name:match("%.init$") then + cur_name, cur_version = manif.get_current_provider(item_type, (item_name:gsub("%.init$", ""))) + end + if (not cur_name) or (name < cur_name) or (name == cur_name and (version == cur_version -- cgit v1.2.3-55-g6feb