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.lua31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua
index 26c43047..27062cbb 100644
--- a/src/luarocks/deps.lua
+++ b/src/luarocks/deps.lua
@@ -17,6 +17,7 @@ local cfg = require("luarocks.cfg")
17local manif_core = require("luarocks.manif_core") 17local manif_core = require("luarocks.manif_core")
18local path = require("luarocks.path") 18local path = require("luarocks.path")
19local dir = require("luarocks.dir") 19local dir = require("luarocks.dir")
20local util = require("luarocks.util")
20 21
21local operators = { 22local operators = {
22 ["=="] = "==", 23 ["=="] = "==",
@@ -135,7 +136,7 @@ function parse_version(vstring)
135 -- extract a word 136 -- extract a word
136 token, rest = vstring:match("^(%a+)[%.%-%_]*(.*)") 137 token, rest = vstring:match("^(%a+)[%.%-%_]*(.*)")
137 if not token then 138 if not token then
138 print("Warning: version number '"..vstring.."' could not be parsed.") 139 util.printerr("Warning: version number '"..vstring.."' could not be parsed.")
139 version[i] = 0 140 version[i] = 0
140 break 141 break
141 end 142 end
@@ -435,34 +436,34 @@ function fulfill_dependencies(rockspec)
435 local matched, missing, no_upgrade = match_deps(rockspec) 436 local matched, missing, no_upgrade = match_deps(rockspec)
436 437
437 if next(no_upgrade) then 438 if next(no_upgrade) then
438 print("Missing dependencies for "..rockspec.name.." "..rockspec.version..":") 439 util.printerr("Missing dependencies for "..rockspec.name.." "..rockspec.version..":")
439 for _, dep in pairs(no_upgrade) do 440 for _, dep in pairs(no_upgrade) do
440 print(show_dep(dep)) 441 util.printerr(show_dep(dep))
441 end 442 end
442 if next(missing) then 443 if next(missing) then
443 for _, dep in pairs(missing) do 444 for _, dep in pairs(missing) do
444 print(show_dep(dep)) 445 util.printerr(show_dep(dep))
445 end 446 end
446 end 447 end
447 print() 448 util.printerr()
448 for _, dep in pairs(no_upgrade) do 449 for _, dep in pairs(no_upgrade) do
449 print("This version of "..rockspec.name.." is designed for use with") 450 util.printerr("This version of "..rockspec.name.." is designed for use with")
450 print(show_dep(dep)..", but is configured to avoid upgrading it") 451 util.printerr(show_dep(dep)..", but is configured to avoid upgrading it")
451 print("automatically. Please upgrade "..dep.name.." with") 452 util.printerr("automatically. Please upgrade "..dep.name.." with")
452 print(" luarocks install "..dep.name) 453 util.printerr(" luarocks install "..dep.name)
453 print("or choose an older version of "..rockspec.name.." with") 454 util.printerr("or choose an older version of "..rockspec.name.." with")
454 print(" luarocks search "..rockspec.name) 455 util.printerr(" luarocks search "..rockspec.name)
455 end 456 end
456 return nil, "Failed matching dependencies." 457 return nil, "Failed matching dependencies."
457 end 458 end
458 459
459 if next(missing) then 460 if next(missing) then
460 print() 461 util.printerr()
461 print("Missing dependencies for "..rockspec.name..":") 462 util.printerr("Missing dependencies for "..rockspec.name..":")
462 for _, dep in pairs(missing) do 463 for _, dep in pairs(missing) do
463 print(show_dep(dep)) 464 util.printerr(show_dep(dep))
464 end 465 end
465 print() 466 util.printerr()
466 467
467 for _, dep in pairs(missing) do 468 for _, dep in pairs(missing) do
468 -- Double-check in case dependency was filled during recursion. 469 -- Double-check in case dependency was filled during recursion.