From ecf0dc01952f8e2c4013aa0964b70ac82b25ae04 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 4 Jul 2014 23:13:51 +0200 Subject: prosodyctl: Show relative paths in about --- prosodyctl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'prosodyctl') diff --git a/prosodyctl b/prosodyctl index bfb118c3..60bc0c08 100755 --- a/prosodyctl +++ b/prosodyctl @@ -528,16 +528,18 @@ function commands.about(arg) return 1; end + local pwd = "."; local array = require "util.array"; local keys = require "util.iterators".keys; + 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("Plugin directory: "..relpath(pwd, CFG_PLUGINDIR or ".")); + print("Config directory: "..relpath(pwd, CFG_CONFIGDIR or ".")); + print("Source directory: "..relpath(pwd, CFG_SOURCEDIR or ".")); print(""); print("# Lua environment"); print("Lua version: ", _G._VERSION); -- cgit v1.2.3 From 7193adf5d5cbc0a0bd0e49488b4590e3dff19ab2 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 21 Jan 2015 02:55:23 +0100 Subject: prosodyctl: Use util.mercurial to identify hg repository and revision --- prosodyctl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'prosodyctl') diff --git a/prosodyctl b/prosodyctl index 60bc0c08..c7daceac 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 -- cgit v1.2.3 From 13edf3e093fd656d5110b277eca4c9805f3d925c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 21 Jan 2015 02:55:27 +0100 Subject: prosodyctl: Expand plugin paths and attempt to identify prosody-modules checkouts --- prosodyctl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'prosodyctl') diff --git a/prosodyctl b/prosodyctl index c7daceac..abf9bf95 100755 --- a/prosodyctl +++ b/prosodyctl @@ -532,17 +532,30 @@ function commands.about(arg) 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: "..relpath(pwd, data_path)); - print("Plugin directory: "..relpath(pwd, CFG_PLUGINDIR or ".")); 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); -- cgit v1.2.3