@@ -673,7 +673,7 @@ build_package_standard() {
673673 if [ " $package_var_name " = " RUBY" ]; then
674674 # shellcheck disable=SC2155
675675 local ruby_semver=" $( normalize_semver " ${package_name# ruby-} " ) "
676- if [[ " $RUBY_CONFIGURE_OPTS ${RUBY_CONFIGURE_OPTS_ARRAY[*]} " != * --with-readline-dir= * && " $ruby_semver " -lt 300300 ]]; then
676+ if [[ " $RUBY_CONFIGURE_OPTS ${RUBY_CONFIGURE_OPTS_ARRAY[*]} " != * --with-readline-dir= * && " $ruby_semver " -lt 30300 ]]; then
677677 # Ruby 3.3+ does not need external readline: https://github.com/rbenv/ruby-build/issues/2330
678678 use_homebrew_readline || use_freebsd_readline || true
679679 fi
@@ -691,7 +691,7 @@ build_package_standard() {
691691 # use openssl installed from Ports Collection
692692 package_option ruby configure --with-openssl-dir=" /usr/local"
693693 fi
694- elif [ " $ruby_semver " -lt 200707 ]; then
694+ elif [ " $ruby_semver " -lt 20707 ]; then
695695 local opt
696696 for opt in $RUBY_CONFIGURE_OPTS " ${RUBY_CONFIGURE_OPTS_ARRAY[@]} " ; do
697697 if [[ $opt == --with-openssl-dir= * ]]; then
@@ -709,7 +709,7 @@ build_package_standard() {
709709 fi
710710 if [[ " $RUBY_CONFIGURE_OPTS ${RUBY_CONFIGURE_OPTS_ARRAY[*]} " != * --with-ext* &&
711711 " $RUBY_CONFIGURE_OPTS ${RUBY_CONFIGURE_OPTS_ARRAY[*]} " != * --without-ext* &&
712- " $ruby_semver " -ge 200500 ]]; then
712+ " $ruby_semver " -ge 20500 ]]; then
713713 # For Ruby 2.5+, fail the `make` step if any of these extensions were not compiled.
714714 # Otherwise, the build would have succeeded, but Ruby would be useless at runtime.
715715 # https://github.com/ruby/ruby/commit/b58a30e1c14e971adba4096104274d5d692492e9
@@ -722,7 +722,7 @@ build_package_standard() {
722722 fi
723723 if [ -z " $CC " ] && is_mac 1010; then
724724 export CC=clang
725- elif [ " $ruby_semver " -lt 300200 ] && is_fedora 42; then
725+ elif [ " $ruby_semver " -lt 30200 ] && is_fedora 42; then
726726 # Fedora 42+ has updated to GCC v15. GCC v15 changed the default
727727 # mode from gnu17 to gnu23: https://gcc.gnu.org/gcc-15/changes.html#c
728728 #
@@ -1146,13 +1146,10 @@ homebrew_openssl_versions() {
11461146}
11471147
11481148# Normalizes "X.Y.Z" into a comparable numeric value. Does not support prereleases.
1149+ # Example: 3.1.23 -> 30123
11491150# See also osx_version, require_java
11501151normalize_semver () {
1151- local ver
1152- IFS=. read -d " " -r -a ver <<< " $1" || true
1153- IFS=" $OLDIFS "
1154- # 3.1.23 -> 300_123
1155- echo $(( ver[0 ]* 100000 + ver[1 ]* 100 + ver[2 ] ))
1152+ awk -F. ' {print $1 * 10000 + $2 * 100 + $3}' <<< " $1"
11561153}
11571154
11581155# Checks if system OpenSSL does NOT satisfy the version requirement
0 commit comments