mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
Fix 'update' command output
So far, ejabberd_update:update/0 returned the return value of
release_handler_1:eval_script/1. That function returns the list of
updated but unpurged modules, i.e., modules where one or more processes
are still running an old version of the code. Since commit
5a34020d23
, the ejabberd 'update' command
assumes that value to be the list of updated modules instead. As
that seems more useful, modify ejabberd_update:update/0 accordingly.
This fixes the 'update' command output.
This commit is contained in:
parent
3469a51f58
commit
3d9a5a1635
@ -746,7 +746,7 @@ update_module(ModuleNameString) ->
|
|||||||
case ejabberd_update:update([ModuleName]) of
|
case ejabberd_update:update([ModuleName]) of
|
||||||
{ok, []} ->
|
{ok, []} ->
|
||||||
{ok, "Not updated: "++ModuleNameString};
|
{ok, "Not updated: "++ModuleNameString};
|
||||||
{ok, [{ModuleName, _}]} ->
|
{ok, [ModuleName]} ->
|
||||||
{ok, "Updated: "++ModuleNameString};
|
{ok, "Updated: "++ModuleNameString};
|
||||||
{error, Reason} -> {error, Reason}
|
{error, Reason} -> {error, Reason}
|
||||||
end.
|
end.
|
||||||
|
@ -38,13 +38,17 @@
|
|||||||
%% Update all the modified modules
|
%% Update all the modified modules
|
||||||
update() ->
|
update() ->
|
||||||
case update_info() of
|
case update_info() of
|
||||||
{ok, Dir, _UpdatedBeams, _Script, LowLevelScript, _Check} ->
|
{ok, Dir, UpdatedBeams, _Script, LowLevelScript, _Check} ->
|
||||||
Eval =
|
case eval_script(
|
||||||
eval_script(
|
|
||||||
LowLevelScript, [],
|
LowLevelScript, [],
|
||||||
[{ejabberd, "", filename:join(Dir, "..")}]),
|
[{ejabberd, "", filename:join(Dir, "..")}]) of
|
||||||
|
{ok, _} ->
|
||||||
|
?DEBUG("Updated: ~p~n", [UpdatedBeams]),
|
||||||
|
{ok, UpdatedBeams};
|
||||||
|
Eval ->
|
||||||
?DEBUG("Eval: ~p~n", [Eval]),
|
?DEBUG("Eval: ~p~n", [Eval]),
|
||||||
Eval;
|
Eval
|
||||||
|
end;
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
{error, Reason}
|
{error, Reason}
|
||||||
end.
|
end.
|
||||||
@ -56,12 +60,16 @@ update(ModulesToUpdate) ->
|
|||||||
UpdatedBeamsNow =
|
UpdatedBeamsNow =
|
||||||
[A || A <- UpdatedBeamsAll, B <- ModulesToUpdate, A == B],
|
[A || A <- UpdatedBeamsAll, B <- ModulesToUpdate, A == B],
|
||||||
{_, LowLevelScript, _} = build_script(Dir, UpdatedBeamsNow),
|
{_, LowLevelScript, _} = build_script(Dir, UpdatedBeamsNow),
|
||||||
Eval =
|
case eval_script(
|
||||||
eval_script(
|
|
||||||
LowLevelScript, [],
|
LowLevelScript, [],
|
||||||
[{ejabberd, "", filename:join(Dir, "..")}]),
|
[{ejabberd, "", filename:join(Dir, "..")}]) of
|
||||||
|
{ok, _} ->
|
||||||
|
?DEBUG("Updated: ~p~n", [UpdatedBeamsNow]),
|
||||||
|
{ok, UpdatedBeamsNow};
|
||||||
|
Eval ->
|
||||||
?DEBUG("Eval: ~p~n", [Eval]),
|
?DEBUG("Eval: ~p~n", [Eval]),
|
||||||
Eval;
|
Eval
|
||||||
|
end;
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
{error, Reason}
|
{error, Reason}
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user