aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2020-04-13 19:46:28 -0300
committerHisham Muhammad <hisham@gobolinux.org>2020-04-13 22:27:17 -0300
commit67ea6328e567fd224e7cd8ed23f55571928d7e1b (patch)
treec66d13e8fea685210f6051037bb760c0f5478297 /src
parent312d7f495a1c187ce988d6e19a50c19328c11ed6 (diff)
downloadluarocks-67ea6328e567fd224e7cd8ed23f55571928d7e1b.tar.gz
luarocks-67ea6328e567fd224e7cd8ed23f55571928d7e1b.tar.bz2
luarocks-67ea6328e567fd224e7cd8ed23f55571928d7e1b.zip
fix regression in dependency matching of luarocks.loader
Regression introduced in https://github.com/luarocks/luarocks/commit/65c417e0ecda55f44c691df032163a8c08f0b52a Thanks to @lhemkendreis for the detailed description and suggested fix, which was applied here! Added a regression test which exercises dependency matching. Closes #1175.
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/loader.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/luarocks/loader.lua b/src/luarocks/loader.lua
index 0cc76027..969f4844 100644
--- a/src/luarocks/loader.lua
+++ b/src/luarocks/loader.lua
@@ -149,12 +149,18 @@ local function select_module(module, filter_file_name)
149 for _, tree in ipairs(tree_manifests) do 149 for _, tree in ipairs(tree_manifests) do
150 local entries = tree.manifest.modules[module] 150 local entries = tree.manifest.modules[module]
151 if entries then 151 if entries then
152 add_providers(providers, entries, tree, module, filter_file_name) 152 local n, v, f = add_providers(providers, entries, tree, module, filter_file_name)
153 if n then
154 return n, v, f
155 end
153 else 156 else
154 initmodule = initmodule or module .. ".init" 157 initmodule = initmodule or module .. ".init"
155 entries = tree.manifest.modules[initmodule] 158 entries = tree.manifest.modules[initmodule]
156 if entries then 159 if entries then
157 add_providers(providers, entries, tree, initmodule, filter_file_name) 160 local n, v, f = add_providers(providers, entries, tree, initmodule, filter_file_name)
161 if n then
162 return n, v, f
163 end
158 end 164 end
159 end 165 end
160 end 166 end