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 2021/11/08 22:46:37 UTC

[GitHub] [couchdb-erlfdb] nickva commented on a change in pull request #37: Configure fdb version

nickva commented on a change in pull request #37:
URL: https://github.com/apache/couchdb-erlfdb/pull/37#discussion_r745151878



##########
File path: rebar.config.script
##########
@@ -0,0 +1,34 @@
+% Hacky means to extract API version from fdbcli protocol version output
+% See https://github.com/apple/foundationdb/blob/master/flow/ProtocolVersion.h
+MaxAPIVersion =
+    begin
+        VsnInfo = os:cmd("fdbcli --version"),
+        {match, [ProtocolStr]} = re:run(VsnInfo, "protocol ([a-f0-9]*)", [{capture, [1], list}]),
+        ProtocolVsn = list_to_integer(ProtocolStr, 16),
+        APIVersionBytes = (ProtocolVsn band 16#0000000FFF00000) bsr 20,

Review comment:
       That's quite neat!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org