aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luarocks/deps.lua20
-rwxr-xr-xtest/testing.sh2
2 files changed, 11 insertions, 11 deletions
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua
index 34ef8298..116b4bbb 100644
--- a/src/luarocks/deps.lua
+++ b/src/luarocks/deps.lua
@@ -324,7 +324,7 @@ local function match_dep(dep, blacklist, deps_mode)
324 assert(type(dep) == "table") 324 assert(type(dep) == "table")
325 325
326 local versions = cfg.rocks_provided[dep.name] 326 local versions = cfg.rocks_provided[dep.name]
327 if not cfg.rocks_provided[dep.name] then 327 if cfg.rocks_provided[dep.name] then
328 -- provided rocks have higher priority than manifest's rocks 328 -- provided rocks have higher priority than manifest's rocks
329 versions = { cfg.rocks_provided[dep.name] } 329 versions = { cfg.rocks_provided[dep.name] }
330 else 330 else
@@ -366,7 +366,7 @@ end
366-- @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.
367-- Table where keys are program names and values are tables where keys 367-- Table where keys are program names and values are tables where keys
368-- are program versions and values are 'true'. 368-- are program versions and values are 'true'.
369-- @return table, table: A table where keys are dependencies parsed 369-- @return table, table, table: A table where keys are dependencies parsed
370-- in table format and values are tables containing fields 'name' and 370-- in table format and values are tables containing fields 'name' and
371-- version' representing matches; a table of missing dependencies 371-- version' representing matches; a table of missing dependencies
372-- parsed as tables; and a table of "no-upgrade" missing dependencies 372-- parsed as tables; and a table of "no-upgrade" missing dependencies
@@ -378,16 +378,16 @@ function match_deps(rockspec, blacklist, deps_mode)
378 local matched, missing, no_upgrade = {}, {}, {} 378 local matched, missing, no_upgrade = {}, {}, {}
379 379
380 for _, dep in ipairs(rockspec.dependencies) do 380 for _, dep in ipairs(rockspec.dependencies) do
381 if not cfg.rocks_provided[dep.name] then 381 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) 382 if found then
383 if found then 383 if not cfg.rocks_provided[dep.name] then
384 matched[dep] = found 384 matched[dep] = found
385 end
386 else
387 if dep.constraints[1] and dep.constraints[1].no_upgrade then
388 no_upgrade[dep.name] = dep
385 else 389 else
386 if dep.constraints[1] and dep.constraints[1].no_upgrade then 390 missing[dep.name] = dep
387 no_upgrade[dep.name] = dep
388 else
389 missing[dep.name] = dep
390 end
391 end 391 end
392 end 392 end
393 end 393 end
diff --git a/test/testing.sh b/test/testing.sh
index 0386978a..3a199883 100755
--- a/test/testing.sh
+++ b/test/testing.sh
@@ -397,7 +397,7 @@ fail_admin_remove_missing() { $luarocks_admin --server=testing remove; }
397 397
398fail_deps_mode_invalid_arg() { $luarocks remove luacov --deps-mode; } 398fail_deps_mode_invalid_arg() { $luarocks remove luacov --deps-mode; }
399test_deps_mode_one() { $luarocks build --tree="system" lpeg && $luarocks list && $luarocks build --deps-mode=one --tree="$testing_tree" lxsh && [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 1 ]; } 399test_deps_mode_one() { $luarocks build --tree="system" lpeg && $luarocks list && $luarocks build --deps-mode=one --tree="$testing_tree" lxsh && [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 1 ]; }
400test_deps_mode_order() { $luarocks build --tree="system" lpeg && $luarocks build --deps-mode=order --tree="$testing_tree" lxsh && [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ]; } 400test_deps_mode_order() { $luarocks build --tree="system" lpeg && $luarocks build --deps-mode=order --tree="$testing_tree" lxsh && $luarocks_noecho list --tree="$testing_tree" --porcelain lpeg && [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ]; }
401test_deps_mode_order_sys() { $luarocks build --tree="$testing_tree" lpeg && $luarocks build --deps-mode=order --tree="$testing_sys_tree" lxsh && [ `$luarocks_noecho list --tree="$testing_sys_tree" --porcelain lpeg | wc -l` = 1 ]; } 401test_deps_mode_order_sys() { $luarocks build --tree="$testing_tree" lpeg && $luarocks build --deps-mode=order --tree="$testing_sys_tree" lxsh && [ `$luarocks_noecho list --tree="$testing_sys_tree" --porcelain lpeg | wc -l` = 1 ]; }
402test_deps_mode_all_sys() { $luarocks build --tree="$testing_tree" lpeg && $luarocks build --deps-mode=all --tree="$testing_sys_tree" lxsh && [ `$luarocks_noecho list --tree="$testing_sys_tree" --porcelain lpeg | wc -l` = 0 ]; } 402test_deps_mode_all_sys() { $luarocks build --tree="$testing_tree" lpeg && $luarocks build --deps-mode=all --tree="$testing_sys_tree" lxsh && [ `$luarocks_noecho list --tree="$testing_sys_tree" --porcelain lpeg | wc -l` = 0 ]; }
403test_deps_mode_none() { $luarocks build --tree="$testing_tree" --deps-mode=none lxsh; [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ]; } 403test_deps_mode_none() { $luarocks build --tree="$testing_tree" --deps-mode=none lxsh; [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ]; }