Diff

util/prosodyctl.lua @ 11490:34d4e4a01ef8

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.
author Kim Alvefur <zash@zash.se>
date Tue, 16 Mar 2021 02:44:22 +0100
parent 11299:abe8cd8fad14
child 12785:123d74bf60e3
line wrap: on
line diff
--- 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;