summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rebar.config.script42
1 files changed, 32 insertions, 10 deletions
diff --git a/rebar.config.script b/rebar.config.script
index 139abd60f..dbc5d0a4f 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -27,25 +27,47 @@ end.
VerList = lists:map(fun(X) -> {Int, _} = string:to_integer(X), Int end,
string:tokens(VerString, ".")).
+
+ErlangTooOld = fun(Ver) -.
+ Msg = "This version of Erlang (~p) is too old for~n"
+ "use with Apache CouchDB.~n",
+ io:fwrite(Msg, [Ver]),
+ halt(1)
+end.
+
NotSupported = fun(Ver) ->
- io:fwrite("CouchDB does not support this version of Erlang (~p).~n", [Ver]),
- io:fwrite("Check https://docs.couchdb.org/en/latest/whatsnew/index.html for the~n"),
- io:fwrite("latest information on supported releases.~n"),
+ Msg = "This version of Erlang (~p) is not officially~n"
+ "supported by Apache CouchDB.~n"
+ "While we do not officially support this version,~n"
+ "there are also no known bugs or incompatibilities.~n",
+ io:fwrite(Msg, [Ver])
+end.
+
+BadErlang = fun(Ver) ->
+ Msg = "This version of Erlang (~p) is known to contain~n"
+ "bugs that directly affect the correctness of~n"
+ "Apache CouchDB.~n~n"
+ "You should *NOT* use this version.~n"
+ end,
+ io:fwrite(Msg, [Ver]),
case os:getenv("TRAVIS") of
"true" ->
io:fwrite("Travis run, ignoring bad release. You have been warned!~n"),
ok;
- _ -> halt(1)
+ _ ->
+ halt(1)
end
end.
case VerList of
- [20 | _] = V20 when V20 < [20, 3, 8, 11] -> NotSupported(VerString);
- [20 | _] = V20 when V20 >= [20, 3, 8, 11] -> ok;
- [21, 2] -> NotSupported(VerString);
- [21, 2, N | _] when N < 3 -> NotSupported(VerString);
- [22, 0] -> NotSupported(VerString);
- [22, 0, N | _] when N < 5 -> NotSupported(VerString);
+ [OldVer | _] when OldVer < 19 -> ErlangTooOld(VerString),
+
+ [19 | _] -> NotSupported(VerString),
+
+ [20 | _] = V20 when V20 < [20, 3, 8, 11] -> BadErlang(VerString);
+ [21, 2, N | _] when N < 3 -> BadErlang(VerString);
+ [22, 0, N | _] when N < 5 -> BadErlang(VerString);
+
_ -> ok
end.