prosodyctl
changeset 10968 d6a3d652ca32
parent 10909 709255e332d8
child 11006 b0766f2603e9
equal deleted inserted replaced
10967:80733851be8b 10968:d6a3d652ca32
   440 	print("# Lua module versions");
   440 	print("# Lua module versions");
   441 	local module_versions, longest_name = {}, 8;
   441 	local module_versions, longest_name = {}, 8;
   442 	local luaevent =dependencies.softreq"luaevent";
   442 	local luaevent =dependencies.softreq"luaevent";
   443 	dependencies.softreq"ssl";
   443 	dependencies.softreq"ssl";
   444 	dependencies.softreq"DBI";
   444 	dependencies.softreq"DBI";
       
   445 	local lunbound = dependencies.softreq"lunbound";
   445 	for name, module in pairs(package.loaded) do
   446 	for name, module in pairs(package.loaded) do
   446 		if type(module) == "table" and rawget(module, "_VERSION")
   447 		if type(module) == "table" and rawget(module, "_VERSION")
   447 		and name ~= "_G" and not name:match("%.") then
   448 		and name ~= "_G" and not name:match("%.") then
   448 			if #name > longest_name then
   449 			if #name > longest_name then
   449 				longest_name = #name;
   450 				longest_name = #name;
   451 			module_versions[name] = module._VERSION;
   452 			module_versions[name] = module._VERSION;
   452 		end
   453 		end
   453 	end
   454 	end
   454 	if luaevent then
   455 	if luaevent then
   455 		module_versions["libevent"] = luaevent.core.libevent_version();
   456 		module_versions["libevent"] = luaevent.core.libevent_version();
       
   457 	end
       
   458 	if lunbound then
       
   459 		if not module_versions["lunbound"] then
       
   460 			module_versions["lunbound"] = "<= 0.5";
       
   461 		end
       
   462 		module_versions["libunbound"] = lunbound._LIBVER;
   456 	end
   463 	end
   457 	local sorted_keys = array.collect(keys(module_versions)):sort();
   464 	local sorted_keys = array.collect(keys(module_versions)):sort();
   458 	for _, name in ipairs(sorted_keys) do
   465 	for _, name in ipairs(sorted_keys) do
   459 		print(name..":"..string.rep(" ", longest_name-#name), module_versions[name]);
   466 		print(name..":"..string.rep(" ", longest_name-#name), module_versions[name]);
   460 	end
   467 	end