summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2019-12-13 10:15:17 -0600
committerPaul J. Davis <paul.joseph.davis@gmail.com>2019-12-13 10:15:17 -0600
commit01354c7c14943554d0ea5de3bea03fe03b795974 (patch)
tree7bcba878ab4f9ca17590bf3a69d070474cce0299
parent08a9a5ffe6b2dcfeb480c4cdb15d60ececea8442 (diff)
downloadcouchdb-add-old-erlang-warning.tar.gz
Update warning/error messages for Erlang versionsadd-old-erlang-warning
Soft drop support for Erlang 19 with a warning and be more clear in the warnings about the broken versions of Erlang 20+.
-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.