You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2019/12/13 16:15:19 UTC

[couchdb] 01/01: Update warning/error messages for Erlang versions

This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch add-old-erlang-warning
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 01354c7c14943554d0ea5de3bea03fe03b795974
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Fri Dec 13 10:15:17 2019 -0600

    Update warning/error messages for Erlang versions
    
    Soft drop support for Erlang 19 with a warning and be more clear in the
    warnings about the broken versions of Erlang 20+.
---
 rebar.config.script | 42 ++++++++++++++++++++++++++++++++----------
 1 file changed, 32 insertions(+), 10 deletions(-)

diff --git a/rebar.config.script b/rebar.config.script
index 139abd6..dbc5d0a 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.