diff options
author | Leo P <junk@slact.net> | 2019-04-04 17:10:36 -0400 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-04-16 15:14:58 -0300 |
commit | 0c5f8edd5131b14b876fe5964eeb9957c5254df7 (patch) | |
tree | b5275e07bf04697b4adf04322c9d71bfab8c6ddc /src | |
parent | 6000c9a691356dc56c620299a560bba7c47ed221 (diff) | |
download | luarocks-0c5f8edd5131b14b876fe5964eeb9957c5254df7.tar.gz luarocks-0c5f8edd5131b14b876fe5964eeb9957c5254df7.tar.bz2 luarocks-0c5f8edd5131b14b876fe5964eeb9957c5254df7.zip |
fix: handle all-negative supported_platforms rockspec field
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/deps.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index a2b7f0ea..6eb19aba 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua | |||
@@ -202,6 +202,7 @@ function deps.fulfill_dependencies(rockspec, depskey, deps_mode, verify) | |||
202 | assert(type(verify) == "boolean" or verify == nil) | 202 | assert(type(verify) == "boolean" or verify == nil) |
203 | 203 | ||
204 | if rockspec.supported_platforms and next(rockspec.supported_platforms) then | 204 | if rockspec.supported_platforms and next(rockspec.supported_platforms) then |
205 | local all_negative = true | ||
205 | local supported = false | 206 | local supported = false |
206 | for _, plat in pairs(rockspec.supported_platforms) do | 207 | for _, plat in pairs(rockspec.supported_platforms) do |
207 | local neg | 208 | local neg |
@@ -211,13 +212,14 @@ function deps.fulfill_dependencies(rockspec, depskey, deps_mode, verify) | |||
211 | return nil, "This rockspec for "..rockspec.package.." does not support "..plat.." platforms." | 212 | return nil, "This rockspec for "..rockspec.package.." does not support "..plat.." platforms." |
212 | end | 213 | end |
213 | else | 214 | else |
215 | all_negative = false | ||
214 | if cfg.is_platform(plat) then | 216 | if cfg.is_platform(plat) then |
215 | supported = true | 217 | supported = true |
216 | break | 218 | break |
217 | end | 219 | end |
218 | end | 220 | end |
219 | end | 221 | end |
220 | if supported == false then | 222 | if supported == false and not all_negative then |
221 | local plats = cfg.print_platforms() | 223 | local plats = cfg.print_platforms() |
222 | return nil, "This rockspec for "..rockspec.package.." does not support "..plats.." platforms." | 224 | return nil, "This rockspec for "..rockspec.package.." does not support "..plats.." platforms." |
223 | end | 225 | end |