Comparison

prosodyctl @ 11003:c82ede8892fc

prosodyctl about: Split out libraries into a separate section Currently libevent and libunbound would show up under Lua modules but they are not, so a separate section seems more appropriate.
author Kim Alvefur <zash@zash.se>
date Fri, 10 Jul 2020 03:23:10 +0200
parent 11002:b0766f2603e9
child 11004:d175de07dd73
comparison
equal deleted inserted replaced
11002:b0766f2603e9 11003:c82ede8892fc
436 print(""); 436 print("");
437 print("Backend: "..require "net.server".get_backend()); 437 print("Backend: "..require "net.server".get_backend());
438 print(""); 438 print("");
439 print("# Lua module versions"); 439 print("# Lua module versions");
440 local module_versions, longest_name = {}, 8; 440 local module_versions, longest_name = {}, 8;
441 local luaevent =dependencies.softreq"luaevent"; 441 local library_versions = {};
442 dependencies.softreq"ssl"; 442 dependencies.softreq"ssl";
443 dependencies.softreq"DBI"; 443 dependencies.softreq"DBI";
444 local lunbound = dependencies.softreq"lunbound"; 444 local lunbound = dependencies.softreq"lunbound";
445 for name, module in pairs(package.loaded) do 445 for name, module in pairs(package.loaded) do
446 if type(module) == "table" and rawget(module, "_VERSION") 446 if type(module) == "table" and rawget(module, "_VERSION")
449 longest_name = #name; 449 longest_name = #name;
450 end 450 end
451 module_versions[name] = module._VERSION; 451 module_versions[name] = module._VERSION;
452 end 452 end
453 end 453 end
454 if luaevent then
455 module_versions["libevent"] = luaevent.core.libevent_version();
456 end
457 if lunbound then 454 if lunbound then
458 if not module_versions["lunbound"] then 455 if not module_versions["lunbound"] then
459 module_versions["lunbound"] = "<= 0.5"; 456 module_versions["lunbound"] = "<= 0.5";
460 end 457 end
461 module_versions["libunbound"] = lunbound._LIBVER; 458 library_versions["libunbound"] = lunbound._LIBVER;
462 end 459 end
463 for name, version in sorted_pairs(module_versions) do 460 for name, version in sorted_pairs(module_versions) do
461 print(name..":"..string.rep(" ", longest_name-#name), version);
462 end
463 print("");
464 print("# library versions");
465 if require "net.server".event_base then
466 library_versions["libevent"] = require"luaevent".core.libevent_version();
467 end
468 for name, version in sorted_pairs(library_versions) do
464 print(name..":"..string.rep(" ", longest_name-#name), version); 469 print(name..":"..string.rep(" ", longest_name-#name), version);
465 end 470 end
466 print(""); 471 print("");
467 end 472 end
468 473