24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-24 22:25:47 +02:00

Let modules_update_specs report failures (#756)

This commit is contained in:
Christophe Romain 2015-10-23 17:21:19 +02:00
parent 1472bd398a
commit 2a115a83d2

View File

@ -36,6 +36,7 @@
config_dir/0, opt_type/1]).
-include("ejabberd_commands.hrl").
-include("logger.hrl").
-define(REPOS, "https://github.com/processone/ejabberd-contrib").
@ -111,10 +112,19 @@ commands() ->
update() ->
add_sources(?REPOS),
lists:foreach(fun({Package, Spec}) ->
Res = lists:foldl(fun({Package, Spec}, Acc) ->
Path = proplists:get_value(url, Spec, ""),
add_sources(Package, Path)
end, modules_spec(sources_dir(), "*")).
Update = add_sources(Package, Path),
?INFO_MSG("Update package ~s: ~p", [Package, Update]),
case Update of
ok -> Acc;
Error -> [Error|Acc]
end
end, [], modules_spec(sources_dir(), "*")),
case Res of
[] -> ok;
[Error|_] -> Error
end.
available() ->
Jungle = modules_spec(sources_dir(), "*/*"),