diff options
author | Sam James <sam@gentoo.org> | 2021-06-20 23:13:29 +0200 |
---|---|---|
committer | David Seifert <soap@gentoo.org> | 2021-06-20 23:13:29 +0200 |
commit | 5d8cfbbf915df94509a3eddfe733700ed6bba901 (patch) | |
tree | 86ea5ba86b0117e58ae8aa37d6898998a71ad247 /eclass/alternatives.eclass | |
parent | dev-python/pyproject2setuppy: stable 15 for sparc (diff) | |
download | gentoo-5d8cfbbf915df94509a3eddfe733700ed6bba901.tar.gz gentoo-5d8cfbbf915df94509a3eddfe733700ed6bba901.tar.bz2 gentoo-5d8cfbbf915df94509a3eddfe733700ed6bba901.zip |
alternatives.eclass: [QA] add EAPI guard
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'eclass/alternatives.eclass')
-rw-r--r-- | eclass/alternatives.eclass | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/eclass/alternatives.eclass b/eclass/alternatives.eclass index e83326314261..86adc87b6f4c 100644 --- a/eclass/alternatives.eclass +++ b/eclass/alternatives.eclass @@ -6,6 +6,7 @@ # maintainer-needed@gentoo.org # @AUTHOR: # Alastair Tse <liquidx@gentoo.org> (03 Oct 2003) +# @SUPPORTED_EAPIS: 5 6 7 # @BLURB: Creates symlink to the latest version of multiple slotted packages. # @DESCRIPTION: # When a package is SLOT'ed, very often we need to have a symlink to the @@ -40,6 +41,16 @@ # link to. It is probably more robust against version upgrades. You should # consider using this unless you are want to do something special. +case ${EAPI} in + [5-7]) ;; + *) die "EAPI=${EAPI:-0} is not supported" ;; +esac + +EXPORT_FUNCTIONS pkg_postinst pkg_postrm + +if [[ -z ${_ALTERNATIVES_ECLASS} ]]; then +_ALTERNATIVES_ECLASS=1 + # @ECLASS-VARIABLE: SOURCE # @DEFAULT_UNSET # @DESCRIPTION: @@ -54,7 +65,6 @@ # @DESCRIPTION: # automatic deduction based on a symlink and a regex mask alternatives_auto_makesym() { - has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}" local SYMLINK REGEX ALT myregex SYMLINK=$1 REGEX=$2 @@ -75,7 +85,6 @@ alternatives_auto_makesym() { } alternatives_makesym() { - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= local ALTERNATIVES="" local SYMLINK="" local alt pref @@ -123,7 +132,7 @@ alternatives_makesym() { fi } -# @FUNCTION: alernatives-pkg_postinst +# @FUNCTION: alternatives_pkg_postinst # @DESCRIPTION: # The alternatives pkg_postinst, this function will be exported alternatives_pkg_postinst() { @@ -141,4 +150,4 @@ alternatives_pkg_postrm() { fi } -EXPORT_FUNCTIONS pkg_postinst pkg_postrm +fi |