aboutsummaryrefslogtreecommitdiff
path: root/src/luarocks/deps.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/luarocks/deps.lua')
-rw-r--r--src/luarocks/deps.lua21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua
index 6d5f3fef..7aefd40e 100644
--- a/src/luarocks/deps.lua
+++ b/src/luarocks/deps.lua
@@ -290,15 +290,18 @@ function match_constraints(version, constraints)
290 local ok = true 290 local ok = true
291 setmetatable(version, version_mt) 291 setmetatable(version, version_mt)
292 for _, constr in pairs(constraints) do 292 for _, constr in pairs(constraints) do
293 local constr_version = constr.version 293 if type(constr.version) == "string" then
294 setmetatable(constr.version, version_mt) 294 constr.version = parse_version(constr.version)
295 if constr.op == "==" then ok = version == constr_version 295 end
296 elseif constr.op == "~=" then ok = version ~= constr_version 296 local constr_version, constr_op = constr.version, constr.op
297 elseif constr.op == ">" then ok = version > constr_version 297 setmetatable(constr_version, version_mt)
298 elseif constr.op == "<" then ok = version < constr_version 298 if constr_op == "==" then ok = version == constr_version
299 elseif constr.op == ">=" then ok = version >= constr_version 299 elseif constr_op == "~=" then ok = version ~= constr_version
300 elseif constr.op == "<=" then ok = version <= constr_version 300 elseif constr_op == ">" then ok = version > constr_version
301 elseif constr.op == "~>" then ok = partial_match(version, constr_version) 301 elseif constr_op == "<" then ok = version < constr_version
302 elseif constr_op == ">=" then ok = version >= constr_version
303 elseif constr_op == "<=" then ok = version <= constr_version
304 elseif constr_op == "~>" then ok = partial_match(version, constr_version)
302 end 305 end
303 if not ok then break end 306 if not ok then break end
304 end 307 end