From 15d97c6d5c4e1acade2f983adb507e266b87aa93 Mon Sep 17 00:00:00 2001 From: Dude112113 Date: Mon, 9 Sep 2019 18:25:01 +0100 Subject: vers: add extra metamethod needed by Lua 5.4 (#1088) --- src/luarocks/core/vers.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/luarocks/core/vers.lua b/src/luarocks/core/vers.lua index c8c66a1f..e680f70b 100644 --- a/src/luarocks/core/vers.lua +++ b/src/luarocks/core/vers.lua @@ -56,6 +56,12 @@ local version_mt = { end return false end, + -- @param v1 table: version table to compare. + -- @param v2 table: version table to compare. + -- @return boolean: true if v1 is considered lower than or equal to v2. + __le = function(v1, v2) + return not (v2 < v1) + end, --- Return version as a string. -- @param v The version table. -- @return The string representation. -- cgit v1.2.3-55-g6feb