core.modulemanager: Add compat for LuaRocks 2.x

This commit is contained in:
Kim Alvefur 2020-10-07 22:54:12 +02:00
parent 58be93c184
commit 387a03e1d3

View file

@ -206,6 +206,13 @@ local function do_load_module(host, module_name, state)
local luarocks_path = custom_plugins.."/lib/luarocks/rocks-"..lua_version; local luarocks_path = custom_plugins.."/lib/luarocks/rocks-"..lua_version;
local manifest_filename = luarocks_path.."/manifest"; local manifest_filename = luarocks_path.."/manifest";
local load_manifest, err = envload.envloadfile(manifest_filename, 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 if not load_manifest then
log("error", "Could not load manifest of installed plugins: %s", err, load_manifest); log("error", "Could not load manifest of installed plugins: %s", err, load_manifest);
else else