diff options
author | Matthew Wild <mwild1@gmail.com> | 2015-03-24 13:41:18 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2015-03-24 13:41:18 +0000 |
commit | 829b01aba17e13d75c13679fe6343171378e25d9 (patch) | |
tree | e4fca8b30e86975bf10ef581f281c91603e7eed8 /prosodyctl | |
parent | f7786f4031dad5dd2daaf92c7c099448334d892d (diff) | |
parent | 13edf3e093fd656d5110b277eca4c9805f3d925c (diff) | |
download | prosody-829b01aba17e13d75c13679fe6343171378e25d9.tar.gz prosody-829b01aba17e13d75c13679fe6343171378e25d9.zip |
Merge 0.10->trunk
Diffstat (limited to 'prosodyctl')
-rwxr-xr-x | prosodyctl | 28 |
1 files changed, 23 insertions, 5 deletions
@@ -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); |