mirror of
https://github.com/bjc/prosody.git
synced 2025-04-01 20:27:39 +03:00
executables: Prefix module imports with prosody namespace
This commit is contained in:
parent
b17564a71f
commit
9c63ae60fd
2 changed files with 21 additions and 21 deletions
6
prosody
6
prosody
|
@ -55,8 +55,8 @@ if not pcall(require, "prosody.loader") then
|
||||||
pcall(require, "loader");
|
pcall(require, "loader");
|
||||||
end
|
end
|
||||||
|
|
||||||
local startup = require "util.startup";
|
local startup = require "prosody.util.startup";
|
||||||
local async = require "util.async";
|
local async = require "prosody.util.async";
|
||||||
|
|
||||||
-- Note: it's important that this thread is not GC'd, as some C libraries
|
-- Note: it's important that this thread is not GC'd, as some C libraries
|
||||||
-- that are initialized here store a pointer to it ( :/ ).
|
-- that are initialized here store a pointer to it ( :/ ).
|
||||||
|
@ -83,7 +83,7 @@ local function loop()
|
||||||
end
|
end
|
||||||
|
|
||||||
local sleep = require"socket".sleep;
|
local sleep = require"socket".sleep;
|
||||||
local server = require "net.server";
|
local server = require "prosody.net.server";
|
||||||
|
|
||||||
while select(2, xpcall(server.loop, catch_uncaught_error)) ~= "quitting" do
|
while select(2, xpcall(server.loop, catch_uncaught_error)) ~= "quitting" do
|
||||||
sleep(0.2);
|
sleep(0.2);
|
||||||
|
|
36
prosodyctl
36
prosodyctl
|
@ -55,22 +55,22 @@ if not pcall(require, "prosody.loader") then
|
||||||
pcall(require, "loader");
|
pcall(require, "loader");
|
||||||
end
|
end
|
||||||
|
|
||||||
local startup = require "util.startup";
|
local startup = require "prosody.util.startup";
|
||||||
startup.prosodyctl();
|
startup.prosodyctl();
|
||||||
|
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
local configmanager = require "core.configmanager";
|
local configmanager = require "prosody.core.configmanager";
|
||||||
local modulemanager = require "core.modulemanager"
|
local modulemanager = require "prosody.core.modulemanager"
|
||||||
local prosodyctl = require "util.prosodyctl"
|
local prosodyctl = require "prosody.util.prosodyctl"
|
||||||
local socket = require "socket"
|
local socket = require "socket"
|
||||||
local dependencies = require "util.dependencies";
|
local dependencies = require "prosody.util.dependencies";
|
||||||
local lfs = dependencies.softreq "lfs";
|
local lfs = dependencies.softreq "lfs";
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
local parse_args = require "util.argparse".parse;
|
local parse_args = require "prosody.util.argparse".parse;
|
||||||
local human_io = require "util.human.io";
|
local human_io = require "prosody.util.human.io";
|
||||||
|
|
||||||
local show_message, show_warning = prosodyctl.show_message, prosodyctl.show_warning;
|
local show_message, show_warning = prosodyctl.show_message, prosodyctl.show_warning;
|
||||||
local show_usage = prosodyctl.show_usage;
|
local show_usage = prosodyctl.show_usage;
|
||||||
|
@ -78,7 +78,7 @@ local read_password = human_io.read_password;
|
||||||
local call_luarocks = prosodyctl.call_luarocks;
|
local call_luarocks = prosodyctl.call_luarocks;
|
||||||
local error_messages = prosodyctl.error_messages;
|
local error_messages = prosodyctl.error_messages;
|
||||||
|
|
||||||
local jid_split = require "util.jid".prepped_split;
|
local jid_split = require "prosody.util.jid".prepped_split;
|
||||||
|
|
||||||
local prosodyctl_timeout = (configmanager.get("*", "prosodyctl_timeout") or 5) * 2;
|
local prosodyctl_timeout = (configmanager.get("*", "prosodyctl_timeout") or 5) * 2;
|
||||||
-----------------------
|
-----------------------
|
||||||
|
@ -438,8 +438,8 @@ function commands.about(arg)
|
||||||
end
|
end
|
||||||
|
|
||||||
local pwd = ".";
|
local pwd = ".";
|
||||||
local sorted_pairs = require "util.iterators".sorted_pairs;
|
local sorted_pairs = require "prosody.util.iterators".sorted_pairs;
|
||||||
local hg = require"util.mercurial";
|
local hg = require"prosody.util.mercurial";
|
||||||
local relpath = configmanager.resolve_relative_path;
|
local relpath = configmanager.resolve_relative_path;
|
||||||
|
|
||||||
print("Prosody "..(prosody.version or "(unknown version)"));
|
print("Prosody "..(prosody.version or "(unknown version)"));
|
||||||
|
@ -461,7 +461,7 @@ function commands.about(arg)
|
||||||
.."\n ";
|
.."\n ";
|
||||||
end)));
|
end)));
|
||||||
print("");
|
print("");
|
||||||
local have_pposix, pposix = pcall(require, "util.pposix");
|
local have_pposix, pposix = pcall(require, "prosody.util.pposix");
|
||||||
if have_pposix and pposix.uname then
|
if have_pposix and pposix.uname then
|
||||||
print("# Operating system");
|
print("# Operating system");
|
||||||
local uname, err = pposix.uname();
|
local uname, err = pposix.uname();
|
||||||
|
@ -494,7 +494,7 @@ function commands.about(arg)
|
||||||
print("");
|
print("");
|
||||||
print("# Network");
|
print("# Network");
|
||||||
print("");
|
print("");
|
||||||
print("Backend: "..require "net.server".get_backend());
|
print("Backend: "..require "prosody.net.server".get_backend());
|
||||||
print("");
|
print("");
|
||||||
print("# Lua module versions");
|
print("# Lua module versions");
|
||||||
local module_versions, longest_name = {}, 8;
|
local module_versions, longest_name = {}, 8;
|
||||||
|
@ -516,7 +516,7 @@ function commands.about(arg)
|
||||||
}
|
}
|
||||||
local lunbound = dependencies.softreq"lunbound";
|
local lunbound = dependencies.softreq"lunbound";
|
||||||
local lxp = dependencies.softreq"lxp";
|
local lxp = dependencies.softreq"lxp";
|
||||||
local hashes = dependencies.softreq"util.hashes";
|
local hashes = dependencies.softreq"prosody.util.hashes";
|
||||||
for name, module in pairs(package.loaded) do
|
for name, module in pairs(package.loaded) do
|
||||||
local version_field = alternate_version_fields[name] or "_VERSION";
|
local version_field = alternate_version_fields[name] or "_VERSION";
|
||||||
if type(module) == "table" and rawget(module, version_field)
|
if type(module) == "table" and rawget(module, version_field)
|
||||||
|
@ -549,7 +549,7 @@ function commands.about(arg)
|
||||||
end
|
end
|
||||||
print("");
|
print("");
|
||||||
print("# library versions");
|
print("# library versions");
|
||||||
if require "net.server".event_base then
|
if require "prosody.net.server".event_base then
|
||||||
library_versions["libevent"] = require"luaevent".core.libevent_version();
|
library_versions["libevent"] = require"luaevent".core.libevent_version();
|
||||||
end
|
end
|
||||||
for name, version in sorted_pairs(library_versions) do
|
for name, version in sorted_pairs(library_versions) do
|
||||||
|
@ -639,8 +639,8 @@ end
|
||||||
|
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
local async = require "util.async";
|
local async = require "prosody.util.async";
|
||||||
local server = require "net.server";
|
local server = require "prosody.net.server";
|
||||||
local watchers = {
|
local watchers = {
|
||||||
error = function (_, err)
|
error = function (_, err)
|
||||||
error(err);
|
error(err);
|
||||||
|
@ -686,7 +686,7 @@ local command_runner = async.runner(function ()
|
||||||
end
|
end
|
||||||
|
|
||||||
if command and not commands[command] then
|
if command and not commands[command] then
|
||||||
local ok, command_module = pcall(require, "util.prosodyctl."..command);
|
local ok, command_module = pcall(require, "prosody.util.prosodyctl."..command);
|
||||||
if ok and command_module[command] then
|
if ok and command_module[command] then
|
||||||
commands[command] = command_module[command];
|
commands[command] = command_module[command];
|
||||||
end
|
end
|
||||||
|
@ -703,7 +703,7 @@ local command_runner = async.runner(function ()
|
||||||
print("");
|
print("");
|
||||||
print("Where COMMAND may be one of:");
|
print("Where COMMAND may be one of:");
|
||||||
|
|
||||||
local hidden_commands = require "util.set".new{ "register", "unregister" };
|
local hidden_commands = require "prosody.util.set".new{ "register", "unregister" };
|
||||||
local commands_order = {
|
local commands_order = {
|
||||||
"Process management:",
|
"Process management:",
|
||||||
"start"; "stop"; "restart"; "reload"; "status";
|
"start"; "stop"; "restart"; "reload"; "status";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue