diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2021-03-16 14:56:33 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2021-03-19 13:15:53 -0300 |
commit | 28723ac33ccc22d62877f893927a561b7fb1ecbf (patch) | |
tree | eba086002546ab048ac93cfe66d44edca1d88951 | |
parent | 2efec770b1b1b27a4b15c3b06a2f5fcadc0b546d (diff) | |
download | luarocks-28723ac33ccc22d62877f893927a561b7fb1ecbf.tar.gz luarocks-28723ac33ccc22d62877f893927a561b7fb1ecbf.tar.bz2 luarocks-28723ac33ccc22d62877f893927a561b7fb1ecbf.zip |
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.
-rw-r--r-- | src/luarocks/repos.lua | 8 |
1 files changed, 8 insertions, 0 deletions
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 | |||
248 | local function check_spot_if_available(name, version, deploy_type, file_path) | 248 | local function check_spot_if_available(name, version, deploy_type, file_path) |
249 | local item_type, item_name = get_provided_item(deploy_type, file_path) | 249 | local item_type, item_name = get_provided_item(deploy_type, file_path) |
250 | local cur_name, cur_version = manif.get_current_provider(item_type, item_name) | 250 | local cur_name, cur_version = manif.get_current_provider(item_type, item_name) |
251 | |||
252 | -- older versions of LuaRocks (< 3) registered "foo.init" files as "foo" | ||
253 | -- (which caused problems, so that behavior was changed). But look for that | ||
254 | -- in the manifest anyway for backward compatibility. | ||
255 | if not cur_name and deploy_type == "lua" and item_name:match("%.init$") then | ||
256 | cur_name, cur_version = manif.get_current_provider(item_type, (item_name:gsub("%.init$", ""))) | ||
257 | end | ||
258 | |||
251 | if (not cur_name) | 259 | if (not cur_name) |
252 | or (name < cur_name) | 260 | or (name < cur_name) |
253 | or (name == cur_name and (version == cur_version | 261 | or (name == cur_name and (version == cur_version |