25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

Add observer and runtime_tools in releases when --enable-tools

When --enable-tools, include observer and runtime_tools
in the OTP releases, as they are required by "ejabberdctl etop".

With this fix, "ejabberdctl etop" works correctly when:
* rebar3 + make rel
* mix + make dev
* mix + make rel
This commit is contained in:
Badlop 2024-01-08 14:54:10 +01:00
parent eeb4be6e4b
commit a2ff5fbfdb
4 changed files with 10 additions and 3 deletions

View File

@ -68,6 +68,7 @@ jobs:
--prefix=/tmp/ejabberd \ --prefix=/tmp/ejabberd \
--enable-all \ --enable-all \
--disable-elixir \ --disable-elixir \
--disable-tools \
--disable-odbc --disable-odbc
make update make update
make make

View File

@ -254,7 +254,7 @@ AC_ARG_ENABLE(system_deps,
esac],[if test "x$system_deps" = "x"; then system_deps=false; fi]) esac],[if test "x$system_deps" = "x"; then system_deps=false; fi])
AC_ARG_ENABLE(tools, AC_ARG_ENABLE(tools,
[AS_HELP_STRING([--enable-tools],[build development tools (default: no)])], [AS_HELP_STRING([--enable-tools],[build development tools: ejabberd-po, etop (default: no)])],
[case "${enableval}" in [case "${enableval}" in
yes) tools=true ;; yes) tools=true ;;
no) tools=false ;; no) tools=false ;;

View File

@ -145,7 +145,9 @@ defmodule Ejabberd.MixProject do
end end
defp cond_apps do defp cond_apps do
for {:true, app} <- [{config(:stun), :stun}], do: for {:true, app} <- [{config(:stun), :stun},
{config(:tools), :observer},
{config(:tools), :runtime_tools}], do:
app app
end end

View File

@ -6,10 +6,14 @@
{elixir, true} -> [elixir, iex, logger, mix]; {elixir, true} -> [elixir, iex, logger, mix];
_ -> [] _ -> []
end, end,
Tools = case lists:keyfind(tools, 1, Terms) of
{tools, true} -> [observer, runtime_tools]; % for `ejabberdctl etop`
_ -> []
end,
{[lists:keyfind(description, 1, Terms), {[lists:keyfind(description, 1, Terms),
lists:keyfind(vsn, 1, Terms), lists:keyfind(vsn, 1, Terms),
{env, [{enabled_backends, EBs}]} {env, [{enabled_backends, EBs}]}
], Elixirs}; ], Elixirs ++ Tools};
_Err -> _Err ->
{[], []} {[], []}
end, end,