util.prosodyctl: Install plugins for current Lua version
Fixes that luarocks defaults to installing the rock for its own runtime
version of Lua.
This only works with luarocks 3.x, it does nothing on 2.x as currently
available from Debian.
--- a/util/prosodyctl.lua Fri Mar 26 13:03:22 2021 +0100
+++ b/util/prosodyctl.lua Tue Mar 16 02:44:22 2021 +0100
@@ -221,8 +221,8 @@
local function call_luarocks(operation, mod, server)
local dir = prosody.paths.installer;
- local ok, _, code = os.execute(render_cli("luarocks {op} --tree={dir} {server&--server={server}} {mod?}", {
- dir = dir; op = operation; mod = mod; server = server;
+ local ok, _, code = os.execute(render_cli("luarocks --lua-version={luav} {op} --tree={dir} {server&--server={server}} {mod?}", {
+ dir = dir; op = operation; mod = mod; server = server; luav = _VERSION:match("5%.%d");
}));
if type(ok) == "number" then code = ok; end
return code;