aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwojas <github@m.wojas.nl>2023-11-01 02:39:10 +0800
committerGitHub <noreply@github.com>2023-10-31 15:39:10 -0300
commitf911b81053f522c4241b9e5e229a318169ed8c4f (patch)
tree1f68cafc84491faed0494e5ecf78da172d329156
parent79066a41ec44e534ae0e794eddc489cfbd2ff134 (diff)
downloadluarocks-f911b81053f522c4241b9e5e229a318169ed8c4f.tar.gz
luarocks-f911b81053f522c4241b9e5e229a318169ed8c4f.tar.bz2
luarocks-f911b81053f522c4241b9e5e229a318169ed8c4f.zip
luajit: ignore extra version info in jit.version (#1519)
Ignore any extra version info in jit.version when separated by a space. A normal LuaJIT jit.version string looks like "LuaJIT 2.1.0-beta3". Since official LuaJIT releases have all but stopped, various forks continue to use the same version for all forks. This change allows forks and patched rebuilds to add additional version information at the end of the string without breaking luarocks version detection, e.g. "LuaJIT 2.1.0-beta3 some-extra-version-info".
-rw-r--r--src/luarocks/util.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua
index fa3a628e..dd05b4ac 100644
--- a/src/luarocks/util.lua
+++ b/src/luarocks/util.lua
@@ -457,7 +457,8 @@ do
457 457
458 local ljv 458 local ljv
459 if cfg.lua_version == "5.1" then 459 if cfg.lua_version == "5.1" then
460 ljv = util.popen_read(Q(cfg.variables["LUA_BINDIR"] .. "/" .. cfg.lua_interpreter) .. ' -e "io.write(tostring(jit and jit.version:gsub([[^%S+ ]], [[]])))"') 460 -- Ignores extra version info for custom builds, e.g. "LuaJIT 2.1.0-beta3 some-other-version-info"
461 ljv = util.popen_read(Q(cfg.variables["LUA_BINDIR"] .. "/" .. cfg.lua_interpreter) .. ' -e "io.write(tostring(jit and jit.version:gsub([[^%S+ (%S+).*]], [[%1]])))"')
461 if ljv == "nil" then 462 if ljv == "nil" then
462 ljv = nil 463 ljv = nil
463 end 464 end