Software /
code /
prosody
Comparison
prosodyctl @ 8701:b7a22baaf55f
prosodyctl: Increase robustness in luarocks version detection (fixes #1003)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 30 Mar 2018 12:12:50 +0200 |
parent | 8671:a4899174a894 |
child | 8718:c23cdeac5b61 |
comparison
equal
deleted
inserted
replaced
8700:d611c46c6787 | 8701:b7a22baaf55f |
---|---|
374 print("Lua C module search paths:"); | 374 print("Lua C module search paths:"); |
375 for path in package.cpath:gmatch("[^;]+") do | 375 for path in package.cpath:gmatch("[^;]+") do |
376 print(" "..path); | 376 print(" "..path); |
377 end | 377 end |
378 print(""); | 378 print(""); |
379 local luarocks_status = (pcall(require, "luarocks.loader") and "Installed ("..(package.loaded["luarocks.cfg"].program_version or "2.x+")..")") | 379 local luarocks_status = "Not installed" |
380 or (pcall(require, "luarocks.require") and "Installed (1.x)") | 380 if pcall(require, "luarocks.loader") then |
381 or "Not installed"; | 381 luarocks_status = "Installed (2.x+)"; |
382 if package.loaded["luarocks.cfg"] then | |
383 luarocks_status = "Installed ("..(package.loaded["luarocks.cfg"].program_version or "2.x+")..")"; | |
384 end | |
385 elseif pcall(require, "luarocks.require") then | |
386 luarocks_status = "Installed (1.x)"; | |
387 end | |
382 print("LuaRocks: ", luarocks_status); | 388 print("LuaRocks: ", luarocks_status); |
383 print(""); | 389 print(""); |
384 print("# Lua module versions"); | 390 print("# Lua module versions"); |
385 local module_versions, longest_name = {}, 8; | 391 local module_versions, longest_name = {}, 8; |
386 local luaevent =dependencies.softreq"luaevent"; | 392 local luaevent =dependencies.softreq"luaevent"; |