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 | 0cbc9ecbecd3caf2bab74dd77abab53ca77691f6 (patch) | |
tree | e4fca8b30e86975bf10ef581f281c91603e7eed8 /prosodyctl | |
parent | c166ec17c2c8bf911877b5810de2555a50afe3ef (diff) | |
parent | 45e1b4d1da5e5c9825e23368d8de92c4c5c390de (diff) | |
download | prosody-0cbc9ecbecd3caf2bab74dd77abab53ca77691f6.tar.gz prosody-0cbc9ecbecd3caf2bab74dd77abab53ca77691f6.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); |