Simplify JRuby version check

In case shelling out to jruby fails, the error output wouldn't get printed to
stderr but ruby-build would abort.
This commit is contained in:
Mislav Marohnić 2024-06-10 11:43:43 +02:00
parent 076d1a2316
commit fb1b4da13d
No known key found for this signature in database
2 changed files with 2 additions and 5 deletions

View file

@ -860,7 +860,7 @@ build_package_jruby() {
cd "${PREFIX_PATH}/bin" cd "${PREFIX_PATH}/bin"
ln -fs jruby ruby ln -fs jruby ruby
chmod +x ruby chmod +x ruby
install_jruby_launcher install_jruby_launcher "$1"
remove_windows_files remove_windows_files
fix_jruby_shebangs fix_jruby_shebangs
} }
@ -869,9 +869,7 @@ install_jruby_launcher() {
# shellcheck disable=SC2164 # shellcheck disable=SC2164
cd "${PREFIX_PATH}/bin" cd "${PREFIX_PATH}/bin"
# workaround for https://github.com/jruby/jruby/issues/7799 # workaround for https://github.com/jruby/jruby/issues/7799
local jruby_version [[ $1 != "jruby-9.2."* ]] ||
jruby_version="$(./ruby -e 'puts JRUBY_VERSION' 2>/dev/null)"
[[ $jruby_version != "9.2."* ]] ||
capture_command ./ruby gem update -q --silent --system 3.3.26 --no-document --no-post-install-message capture_command ./ruby gem update -q --silent --system 3.3.26 --no-document --no-post-install-message
capture_command ./ruby gem install jruby-launcher --no-document capture_command ./ruby gem install jruby-launcher --no-document
} }

View file

@ -848,7 +848,6 @@ DEF
assert_success assert_success
assert_build_log <<OUT assert_build_log <<OUT
jruby [-e,puts JRUBY_VERSION]
jruby [gem,install,jruby-launcher,--no-document] jruby [gem,install,jruby-launcher,--no-document]
OUT OUT