You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2019/01/22 22:30:33 UTC
[GitHub] nickva commented on a change in pull request #1871: [WIP] Blacklist
known bad Erlang releases, fixes #1857
nickva commented on a change in pull request #1871: [WIP] Blacklist known bad Erlang releases, fixes #1857
URL: https://github.com/apache/couchdb/pull/1871#discussion_r249986972
##########
File path: rebar.config.script
##########
@@ -10,6 +11,40 @@
% License for the specific language governing permissions and limitations under
% the License.
+%
+% Blacklist some bad releases.
+%
+{ok, Version} = file:read_file(filename:join(
+ [code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"]
+)).
+
+% Version may be binary if file has /n at end :(
+% there is no string:trim/1 in Erlang 19 :(
+VerString = case Version of
+ V when is_binary(V) -> string:strip(binary_to_list(V), right, $\n);
+ _ -> string:strip(Version, right, $\n)
+end.
+VerList = lists:map(fun(X) -> {Int, _} = string:to_integer(X), Int end,
+ string:tokens(VerString, ".")).
+
+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"),
+ io:fwrite("latest information on supported releases."),
+ halt()
+end.
+
+case VerList of
+ [20] -> NotSupported(VerString);
+ [20, _] -> NotSupported(VerString);
+ [20, _, _] -> NotSupported(VerString);
+ [20, 3, 8, N] when N >= 11 -> ok;
Review comment:
I think we'd need a case for `[20, 3, 8, N] when N < 11 -> NotSupport(VerString)` to catch 20.3.8.10, 20.3.8.9...
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services