diff options
author | Christophe Romain <christophe.romain@process-one.net> | 2015-10-23 17:21:19 +0200 |
---|---|---|
committer | Christophe Romain <christophe.romain@process-one.net> | 2015-10-23 17:21:19 +0200 |
commit | 2a115a83d2b744632602ba378304384889b38afe (patch) | |
tree | 51f5546710ff62961394a8f8e05964ba02e86e78 /src/ext_mod.erl | |
parent | Merge pull request #790 from gardenia/mod_ping_configurable_ack_timeout (diff) |
Let modules_update_specs report failures (#756)
Diffstat (limited to 'src/ext_mod.erl')
-rw-r--r-- | src/ext_mod.erl | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/ext_mod.erl b/src/ext_mod.erl index 765d38b4..ccc847ee 100644 --- a/src/ext_mod.erl +++ b/src/ext_mod.erl @@ -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(), "*/*"), |