Changeset

11147:82d6c8e627b9

core.modulemanager: Add compat for LuaRocks 2.x
author Kim Alvefur <zash@zash.se>
date Wed, 07 Oct 2020 22:54:12 +0200
parents 11146:87d6f5924ae9
children 11148:1dc49accb58e
files core/modulemanager.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/modulemanager.lua	Wed Oct 07 16:10:51 2020 +0200
+++ b/core/modulemanager.lua	Wed Oct 07 22:54:12 2020 +0200
@@ -207,6 +207,13 @@
 		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);