From f6923c65f08c05a9e6c28aab8a75b22ee1f8b2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Sun, 5 Nov 2023 13:56:45 +0100 Subject: [PATCH] Fix checking system OpenSSL version The value of OPENSSL_VERSION_TEXT seems to be printed in double quotes. --- bin/ruby-build | 2 +- test/build.bats | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ruby-build b/bin/ruby-build index 8293d84b..8d2e6970 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -1034,7 +1034,7 @@ has_broken_mac_openssl() { # Detect the OpenSSL version that a compiler can reasonably link to. system_openssl_version() { - cc -xc -E - </dev/null | sed -n 's/OpenSSL \([0-9][0-9.]*\).*/\1/p' + cc -xc -E - </dev/null | sed -n 's/"\{0,1\}OpenSSL \([0-9][0-9.]*\).*/\1/p' #include OPENSSL_VERSION_TEXT EOF diff --git a/test/build.bats b/test/build.bats index 64ab60c4..3f4c5be2 100755 --- a/test/build.bats +++ b/test/build.bats @@ -322,7 +322,7 @@ OUT stub_repeated uname '-s : echo Linux' stub_repeated brew false # shellcheck disable=SC2016 - stub cc '-xc -E - : [[ "$(cat)" == *OPENSSL_VERSION_TEXT* ]] && printf "# 4.0.2\nOpenSSL 1.0.3a 1 Aug 202\n0 errors.\n"' + stub cc '-xc -E - : [[ "$(cat)" == *OPENSSL_VERSION_TEXT* ]] && printf "# 4.0.2\n\"OpenSSL 1.0.3a 1 Aug 202\"\n0 errors.\n"' stub_make_install mkdir -p "$INSTALL_ROOT"/openssl/ssl # OPENSSLDIR