From 204d6cc98fb275865c28653b6eed57060e84255e Mon Sep 17 00:00:00 2001 From: mpeterv Date: Sat, 13 Feb 2016 15:34:20 +0300 Subject: Fix trailing space in dep.show_dep on dep without constraints --- src/luarocks/deps.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index eb01075c..acc571f8 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua @@ -247,12 +247,16 @@ end function deps.show_dep(dep, internal) assert(type(dep) == "table") assert(type(internal) == "boolean" or not internal) - - local pretty = {} - for _, c in ipairs(dep.constraints) do - table.insert(pretty, c.op .. " " .. deps.show_version(c.version, internal)) + + if #dep.constraints > 0 then + local pretty = {} + for _, c in ipairs(dep.constraints) do + table.insert(pretty, c.op .. " " .. deps.show_version(c.version, internal)) + end + return dep.name.." "..table.concat(pretty, ", ") + else + return dep.name end - return dep.name.." "..table.concat(pretty, ", ") end --- A more lenient check for equivalence between versions. -- cgit v1.2.3-55-g6feb