aboutsummaryrefslogtreecommitdiffstats
path: root/prosodyctl
diff options
context:
space:
mode:
Diffstat (limited to 'prosodyctl')
-rwxr-xr-xprosodyctl28
1 files changed, 23 insertions, 5 deletions
diff --git a/prosodyctl b/prosodyctl
index bfb118c3..abf9bf95 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -251,6 +251,7 @@ require "socket"
function read_version()
-- Try to determine version
local version_file = io.open((CFG_SOURCEDIR or ".").."/prosody.version");
+ prosody.version = "unknown";
if version_file then
prosody.version = version_file:read("*a"):gsub("%s*$", "");
version_file:close();
@@ -258,7 +259,9 @@ function read_version()
prosody.version = "hg:"..prosody.version;
end
else
- prosody.version = "unknown";
+ local hg = require"util.mercurial";
+ local hgid = hg.check_id(CFG_SOURCEDIR or ".");
+ if hgid then prosody.version = "hg:" .. hgid; end
end
end
@@ -528,16 +531,31 @@ function commands.about(arg)
return 1;
end
+ local pwd = ".";
+ local lfs = require "lfs";
local array = require "util.array";
local keys = require "util.iterators".keys;
+ local hg = require"util.mercurial";
+ local relpath = config.resolve_relative_path;
print("Prosody "..(prosody.version or "(unknown version)"));
print("");
print("# Prosody directories");
- print("Data directory: ", CFG_DATADIR or "./");
- print("Plugin directory:", CFG_PLUGINDIR or "./");
- print("Config directory:", CFG_CONFIGDIR or "./");
- print("Source directory:", CFG_SOURCEDIR or "./");
+ print("Data directory: "..relpath(pwd, data_path));
+ print("Config directory: "..relpath(pwd, CFG_CONFIGDIR or "."));
+ print("Source directory: "..relpath(pwd, CFG_SOURCEDIR or "."));
+ print("Plugin directories:")
+ print(" "..(prosody.paths.plugins:gsub("([^;]+);?", function(path)
+ local opath = path;
+ path = config.resolve_relative_path(pwd, path);
+ local hgid, hgrepo = hg.check_id(path);
+ if not hgid and hgrepo then
+ return path.." - "..hgrepo .."!\n ";
+ end
+ hgrepo = hgrepo == "010452cfaf53" and "prosody-modules";
+ return path..(hgid and " - "..(hgrepo or "HG").." rev: "..hgid or "")
+ .."\n ";
+ end)));
print("");
print("# Lua environment");
print("Lua version: ", _G._VERSION);