Software / code / prosody
Comparison
core/modulemanager.lua @ 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 |
| parent | 11145:be73df6765b9 |
| child | 11151:498b3ab49b9c |
comparison
equal
deleted
inserted
replaced
| 11146:87d6f5924ae9 | 11147:82d6c8e627b9 |
|---|---|
| 205 local manifest = {}; | 205 local manifest = {}; |
| 206 local luarocks_path = custom_plugins.."/lib/luarocks/rocks-"..lua_version; | 206 local luarocks_path = custom_plugins.."/lib/luarocks/rocks-"..lua_version; |
| 207 local manifest_filename = luarocks_path.."/manifest"; | 207 local manifest_filename = luarocks_path.."/manifest"; |
| 208 local load_manifest, err = envload.envloadfile(manifest_filename, manifest); | 208 local load_manifest, err = envload.envloadfile(manifest_filename, manifest); |
| 209 if not load_manifest then | 209 if not load_manifest then |
| 210 -- COMPAT Luarocks 2.x | |
| 211 log("debug", "Could not load LuaRocks 3.x manifest, trying 2.x", err); | |
| 212 luarocks_path = custom_plugins.."/lib/luarocks/rocks-"..lua_version; | |
| 213 manifest_filename = luarocks_path.."/manifest"; | |
| 214 load_manifest, err = envload.envloadfile(manifest_filename, manifest); | |
| 215 end | |
| 216 if not load_manifest then | |
| 210 log("error", "Could not load manifest of installed plugins: %s", err, load_manifest); | 217 log("error", "Could not load manifest of installed plugins: %s", err, load_manifest); |
| 211 else | 218 else |
| 212 local ok, err = xpcall(load_manifest, debug_traceback); | 219 local ok, err = xpcall(load_manifest, debug_traceback); |
| 213 if not ok then | 220 if not ok then |
| 214 log("error", "Could not load manifest of installed plugins: %s", err); | 221 log("error", "Could not load manifest of installed plugins: %s", err); |