Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2016-07-20 11:11:34 +0300
committerPaweł Chmielowski <pchmielowski@process-one.net>2016-07-20 11:11:34 +0300
commit5458d8bfcba74ff688a388db379ecb0d2e8842b7 (patch)
tree9aeb18322f8c206132791b6d0eb3f3a629d7d392 /rebar.config.script
parent7748dd4e5d249016cdb4edf326c6d73f81f4a3a9 (diff)
Add else branch to if_version_{above,below}
Diffstat (limited to 'rebar.config.script')
-rw-r--r--rebar.config.script16
1 files changed, 15 insertions, 1 deletions
diff --git a/rebar.config.script b/rebar.config.script
index 1e40dea49..ccafba7ec 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -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.