pgj commented on code in PR #4380:
URL: https://github.com/apache/couchdb/pull/4380#discussion_r1072377400


##########
configure:
##########
@@ -30,10 +30,15 @@ WITH_DOCS=1
 ERLANG_MD5="false"
 SKIP_DEPS=0
 
+run_erlang() {
+    erl -noshell -eval "$1" -eval "halt()."
+}
+
 COUCHDB_USER="$(whoami 2>/dev/null || echo couchdb)"
 SM_VSN=${SM_VSN:-"91"}
 ARCH="$(uname -m)"
-ERLANG_VER="$(erl -eval 'io:put_chars(erlang:system_info(otp_release)), 
halt().' -noshell)"
+ERLANG_VER="$(run_erlang 'io:put_chars(erlang:system_info(otp_release)).')"
+ERLANG_OS="$(run_erlang 'case os:type() of {OS, _} -> io:format("~s~n", [OS]) 
end.')"

Review Comment:
   The reason for this twofold: I wanted to be consistent with `rebar` / Erlang 
runtime (I would consider `unix` what it thinks to be UNIX) and avoid 
reimplementing the same logic in shell as well.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to