Comparison

prosodyctl @ 11552:d4b735272a61 0.11

prosodyctl about: Report libexpat version if known
author Matthew Wild <mwild1@gmail.com>
date Tue, 11 May 2021 14:15:22 +0100
parent 11529:10bea0941bab
child 11560:3bbb1af92514
child 11586:35e880501efd
comparison
equal deleted inserted replaced
11551:aaf9c6b6d18d 11552:d4b735272a61
411 print(""); 411 print("");
412 print("Backend: "..require "net.server".get_backend()); 412 print("Backend: "..require "net.server".get_backend());
413 print(""); 413 print("");
414 print("# Lua module versions"); 414 print("# Lua module versions");
415 local module_versions, longest_name = {}, 8; 415 local module_versions, longest_name = {}, 8;
416 local luaevent =dependencies.softreq"luaevent"; 416 local luaevent = dependencies.softreq"luaevent";
417 local lxp = dependencies.softreq"lxp";
417 dependencies.softreq"ssl"; 418 dependencies.softreq"ssl";
418 dependencies.softreq"DBI"; 419 dependencies.softreq"DBI";
419 for name, module in pairs(package.loaded) do 420 for name, module in pairs(package.loaded) do
420 if type(module) == "table" and rawget(module, "_VERSION") 421 if type(module) == "table" and rawget(module, "_VERSION")
421 and name ~= "_G" and not name:match("%.") then 422 and name ~= "_G" and not name:match("%.") then
425 module_versions[name] = module._VERSION; 426 module_versions[name] = module._VERSION;
426 end 427 end
427 end 428 end
428 if luaevent then 429 if luaevent then
429 module_versions["libevent"] = luaevent.core.libevent_version(); 430 module_versions["libevent"] = luaevent.core.libevent_version();
431 end
432 if lxp then
433 module_versions["libexpat"] = lxp._EXPAT_VERSION;
430 end 434 end
431 local sorted_keys = array.collect(keys(module_versions)):sort(); 435 local sorted_keys = array.collect(keys(module_versions)):sort();
432 for _, name in ipairs(sorted_keys) do 436 for _, name in ipairs(sorted_keys) do
433 print(name..":"..string.rep(" ", longest_name-#name), module_versions[name]); 437 print(name..":"..string.rep(" ", longest_name-#name), module_versions[name]);
434 end 438 end