eclass/ruby-utils: Sync with Gentoo

It's from Gentoo commit d18249523bf04913d041c7b28e3104a76db14553.
This commit is contained in:
Krzesimir Nowak 2024-01-30 14:39:01 +01:00
parent aa498b3088
commit 07eb8266fe

View File

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ruby-utils.eclass
@ -22,8 +22,7 @@ esac
if [[ ! ${_RUBY_UTILS} ]]; then
# @ECLASS-VARIABLE: RUBY_TARGETS_PREFERENCE
# @ECLASS_VARIABLE: RUBY_TARGETS_PREFERENCE
# @INTERNAL
# @DESCRIPTION:
# This variable lists all the known ruby targets in preference of use as
@ -33,60 +32,19 @@ if [[ ! ${_RUBY_UTILS} ]]; then
# provide for a better first installation experience.
# All stable RUBY_TARGETS
RUBY_TARGETS_PREFERENCE="ruby26 "
RUBY_TARGETS_PREFERENCE="ruby31 "
# All other active ruby targets
RUBY_TARGETS_PREFERENCE+="ruby27 ruby30"
RUBY_TARGETS_PREFERENCE+="ruby32 ruby33"
_ruby_implementation_depend() {
local rubypn=
local rubyslot=
case $1 in
ruby18)
ruby1[89]|ruby2[0-7]|ruby3[0-3])
rubypn="dev-lang/ruby"
rubyslot=":1.8"
;;
ruby19)
rubypn="dev-lang/ruby"
rubyslot=":1.9"
;;
ruby20)
rubypn="dev-lang/ruby"
rubyslot=":2.0"
;;
ruby21)
rubypn="dev-lang/ruby"
rubyslot=":2.1"
;;
ruby22)
rubypn="dev-lang/ruby"
rubyslot=":2.2"
;;
ruby23)
rubypn="dev-lang/ruby"
rubyslot=":2.3"
;;
ruby24)
rubypn="dev-lang/ruby"
rubyslot=":2.4"
;;
ruby25)
rubypn="dev-lang/ruby"
rubyslot=":2.5"
;;
ruby26)
rubypn="dev-lang/ruby"
rubyslot=":2.6"
;;
ruby27)
rubypn="dev-lang/ruby"
rubyslot=":2.7"
;;
ruby30)
rubypn="dev-lang/ruby"
rubyslot=":3.0"
rubyslot=":${1:4:1}.${1:5}"
;;
ree18)
rubypn="dev-lang/ruby-enterprise"
@ -106,7 +64,5 @@ _ruby_implementation_depend() {
echo "$2${rubypn}$3${rubyslot}"
}
_RUBY_UTILS=1
fi