25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Add else branch to if_version_{above,below}

This commit is contained in:
Paweł Chmielowski 2016-07-20 10:11:34 +02:00
parent 7748dd4e5d
commit 5458d8bfcb

View File

@ -51,6 +51,20 @@ ProcessVars = fun(_F, [], Acc) ->
true ->
F(F, Tail, Acc)
end;
(F, [{Type, Ver, Value, ElseValue} | Tail], Acc) when
Type == if_version_above orelse
Type == if_version_below ->
SysVer = erlang:system_info(otp_release),
Include = if Type == if_version_above ->
SysVer > Ver;
true ->
SysVer < Ver
end,
if Include ->
F(F, Tail, ProcessSingleVar(F, Value, Acc));
true ->
F(F, Tail, ProcessSingleVar(F, ElseValue, Acc))
end;
(F, [{Type, Var, Value} | Tail], Acc) when
Type == if_var_true orelse
Type == if_var_false ->
@ -153,7 +167,7 @@ Conf6 = case {lists:keyfind(cover_enabled, 1, Conf5), os:getenv("TRAVIS")} of
Conf5
end,
%io:format("ejabberd configuration:~n ~p~n", [Conf5]),
%io:format("ejabberd configuration:~n ~p~n", [Conf6]),
Conf6.