]> granicus.if.org Git - ejabberd/commitdiff
Add else branch to if_version_{above,below}
authorPaweł Chmielowski <pchmielowski@process-one.net>
Wed, 20 Jul 2016 08:11:34 +0000 (10:11 +0200)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Wed, 20 Jul 2016 08:11:34 +0000 (10:11 +0200)
rebar.config.script

index 1e40dea4960c4b97448c9f2c3751026a6156fa5b..ccafba7ec9d1a0a941d42452fd031fa612d7ce34 100644 (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.