diff options
author | Kim Alvefur <zash@zash.se> | 2020-10-07 22:54:12 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-10-07 22:54:12 +0200 |
commit | abad51135cdc9e47fd4811e2d6108e5186d71a8e (patch) | |
tree | f74c7a7eea593f5325038961a729fbdae4836a03 /core | |
parent | 16d07ca58c9f360192c67f6e21307f12b5aaa366 (diff) | |
download | prosody-abad51135cdc9e47fd4811e2d6108e5186d71a8e.tar.gz prosody-abad51135cdc9e47fd4811e2d6108e5186d71a8e.zip |
core.modulemanager: Add compat for LuaRocks 2.x
Diffstat (limited to 'core')
-rw-r--r-- | core/modulemanager.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua index ea5a1324..b89c82d7 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -207,6 +207,13 @@ local function do_load_module(host, module_name, state) local manifest_filename = luarocks_path.."/manifest"; local load_manifest, err = envload.envloadfile(manifest_filename, manifest); if not load_manifest then + -- COMPAT Luarocks 2.x + log("debug", "Could not load LuaRocks 3.x manifest, trying 2.x", err); + luarocks_path = custom_plugins.."/lib/luarocks/rocks-"..lua_version; + manifest_filename = luarocks_path.."/manifest"; + load_manifest, err = envload.envloadfile(manifest_filename, manifest); + end + if not load_manifest then log("error", "Could not load manifest of installed plugins: %s", err, load_manifest); else local ok, err = xpcall(load_manifest, debug_traceback); |