commit:     1106f26ff50738702b656c14259eafe543ff7abd
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 20 21:15:49 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Jun 20 21:15:49 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1106f26f

vim-spell.eclass: [QA] add EAPI guard, drop support for < EAPI 6

* Declare supported EAPIs as: [QA] 6, 7
* Add inherit guards to die on unsupported/untested EAPIs
* Add guard to prevent multiple inherits
* Drop obsolete EAPI 0, 1, 2 workarounds

Signed-off-by: Sam James <sam <AT> gentoo.org>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 eclass/vim-spell.eclass | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/eclass/vim-spell.eclass b/eclass/vim-spell.eclass
index baf77221bc9..54bf6b879f7 100644
--- a/eclass/vim-spell.eclass
+++ b/eclass/vim-spell.eclass
@@ -6,6 +6,7 @@
 # Vim Maintainers <v...@gentoo.org>
 # @AUTHOR:
 # Ciaran McCreesh <ciar...@gentoo.org>
+# @SUPPORTED_EAPIS: 6 7
 # @BLURB: Eclass for managing Vim spell files.
 # @DESCRIPTION:
 # How to make a vim spell file package using prebuilt spell lists
@@ -62,8 +63,16 @@
 # spell files. It's best to let upstream know if you've generated spell files
 # for another language rather than keeping them Gentoo-specific.
 
+case ${EAPI:-0} in
+       [67]) ;;
+       *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
 EXPORT_FUNCTIONS src_install pkg_postinst
 
+if [[ -z ${_VIM_SPELL_ECLASS} ]] ; then
+_VIM_SPELL_ECLASS=1
+
 SRC_URI="mirror://gentoo/${P}.tar.bz2"
 SLOT="0"
 
@@ -128,7 +137,6 @@ vim-spell_src_install() {
 # @DESCRIPTION:
 # This function displays installed Vim spell files.
 vim-spell_pkg_postinst() {
-       has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
        echo
        elog "To enable ${VIM_SPELL_LANGUAGE} spell checking, use"
        elog "    :setlocal spell spelllang=${VIM_SPELL_LOCALE}"
@@ -147,3 +155,5 @@ vim-spell_pkg_postinst() {
        elog "    :help spell"
        echo
 }
+
+fi

Reply via email to