diff options
Diffstat (limited to 'src/luarocks/deps.lua')
-rw-r--r-- | src/luarocks/deps.lua | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index 0c6bb8d5..34ef8298 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua | |||
@@ -323,9 +323,10 @@ end | |||
323 | local function match_dep(dep, blacklist, deps_mode) | 323 | local function match_dep(dep, blacklist, deps_mode) |
324 | assert(type(dep) == "table") | 324 | assert(type(dep) == "table") |
325 | 325 | ||
326 | local versions | 326 | local versions = cfg.rocks_provided[dep.name] |
327 | if dep.name == "lua" then | 327 | if not cfg.rocks_provided[dep.name] then |
328 | versions = { cfg.lua_version } | 328 | -- provided rocks have higher priority than manifest's rocks |
329 | versions = { cfg.rocks_provided[dep.name] } | ||
329 | else | 330 | else |
330 | versions = manif_core.get_versions(dep.name, deps_mode) | 331 | versions = manif_core.get_versions(dep.name, deps_mode) |
331 | end | 332 | end |
@@ -360,11 +361,6 @@ local function match_dep(dep, blacklist, deps_mode) | |||
360 | end | 361 | end |
361 | end | 362 | end |
362 | 363 | ||
363 | local whitelist = {} | ||
364 | if cfg.lua_version == "5.2" then | ||
365 | whitelist["bit32"] = true | ||
366 | end | ||
367 | |||
368 | --- Attempt to match dependencies of a rockspec to installed rocks. | 364 | --- Attempt to match dependencies of a rockspec to installed rocks. |
369 | -- @param rockspec table: The rockspec loaded as a table. | 365 | -- @param rockspec table: The rockspec loaded as a table. |
370 | -- @param blacklist table or nil: Program versions to not use as valid matches. | 366 | -- @param blacklist table or nil: Program versions to not use as valid matches. |
@@ -382,12 +378,10 @@ function match_deps(rockspec, blacklist, deps_mode) | |||
382 | local matched, missing, no_upgrade = {}, {}, {} | 378 | local matched, missing, no_upgrade = {}, {}, {} |
383 | 379 | ||
384 | for _, dep in ipairs(rockspec.dependencies) do | 380 | for _, dep in ipairs(rockspec.dependencies) do |
385 | if not whitelist[dep.name] then | 381 | if not cfg.rocks_provided[dep.name] then |
386 | local found = match_dep(dep, blacklist and blacklist[dep.name] or nil, deps_mode) | 382 | local found = match_dep(dep, blacklist and blacklist[dep.name] or nil, deps_mode) |
387 | if found then | 383 | if found then |
388 | if dep.name ~= "lua" then | 384 | matched[dep] = found |
389 | matched[dep] = found | ||
390 | end | ||
391 | else | 385 | else |
392 | if dep.constraints[1] and dep.constraints[1].no_upgrade then | 386 | if dep.constraints[1] and dep.constraints[1].no_upgrade then |
393 | no_upgrade[dep.name] = dep | 387 | no_upgrade[dep.name] = dep |