From 413cdea62d8464908fd50dfc6b6fd35ee3c03fe3 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 23 Aug 2024 22:21:11 -0300 Subject: deps: fix: re-enable constraint check for no_upgrade flag --- src/luarocks/deps.lua | 16 ++++++++-------- src/luarocks/deps.tl | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index f02070a6..f335ebc0 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua @@ -333,14 +333,14 @@ function deps.fulfill_dependencies(rockspec, depskey, deps_mode, verify, deplock if okfulfill then deplocks.add(depskey, depq.name, found_or_err) else - - - - - - - - + if depq.constraints and depq.constraints[1] and depq.constraints[1].no_upgrade then + util.printerr("This version of " .. name .. " is designed for use with") + util.printerr(tostring(depq) .. ", but is configured to avoid upgrading it") + util.printerr("automatically. Please upgrade " .. depq.name .. " with") + util.printerr(" luarocks install " .. depq.name) + util.printerr("or look for a suitable version of " .. name .. " with") + util.printerr(" luarocks search " .. name) + end return nil, found_or_err end end diff --git a/src/luarocks/deps.tl b/src/luarocks/deps.tl index 17584c36..5ca9c879 100644 --- a/src/luarocks/deps.tl +++ b/src/luarocks/deps.tl @@ -333,14 +333,14 @@ function deps.fulfill_dependencies(rockspec: Rockspec, depskey: DepsKey, deps_mo if okfulfill then deplocks.add(depskey, depq.name, found_or_err) else - -- if no_upgrade then - -- util.printerr("This version of "..name.." is designed for use with") - -- util.printerr(tostring(dep)..", but is configured to avoid upgrading it") - -- util.printerr("automatically. Please upgrade "..dep.name.." with") - -- util.printerr(" luarocks install "..dep.name) - -- util.printerr("or look for a suitable version of "..name.." with") - -- util.printerr(" luarocks search "..name) - -- end + if depq.constraints and depq.constraints[1] and depq.constraints[1].no_upgrade then + util.printerr("This version of "..name.." is designed for use with") + util.printerr(tostring(depq)..", but is configured to avoid upgrading it") + util.printerr("automatically. Please upgrade "..depq.name.." with") + util.printerr(" luarocks install "..depq.name) + util.printerr("or look for a suitable version of "..name.." with") + util.printerr(" luarocks search "..name) + end return nil, found_or_err end end -- cgit v1.2.3-55-g6feb