commit:     47cf99c7325d56fd8e455c157c1ec1dcdc8da368
Author:     Marco Sirabella <marco <AT> sirabella <DOT> org>
AuthorDate: Sun Apr 18 07:54:32 2021 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Sun May  2 20:22:28 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47cf99c7

vim-{plugin,spell}: use einstalldocs.

Signed-off-by: Marco Sirabella <marco <AT> sirabella.org>
Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>

 eclass/vim-plugin.eclass | 38 ++++++++------------------------------
 eclass/vim-spell.eclass  |  4 +---
 2 files changed, 9 insertions(+), 33 deletions(-)

diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
index 8b3ddf80ffd..77cceb47ebe 100644
--- a/eclass/vim-plugin.eclass
+++ b/eclass/vim-plugin.eclass
@@ -4,6 +4,7 @@
 # @ECLASS: vim-plugin.eclass
 # @MAINTAINER:
 # [email protected]
+# @SUPPORTED_EAPIS: 6 7
 # @BLURB: used for installing vim plugins
 # @DESCRIPTION:
 # This eclass simplifies installation of app-vim plugins into
@@ -11,7 +12,12 @@
 # which is read automatically by vim.  The only exception is
 # documentation, for which we make a special case via vim-doc.eclass.
 
-inherit estack vim-doc
+case ${EAPI} in
+       6|7);;
+       *) die "EAPI ${EAPI:-0} unsupported (too old)";;
+esac
+
+inherit vim-doc
 EXPORT_FUNCTIONS src_install pkg_postinst pkg_postrm
 
 VIM_PLUGIN_VIM_VERSION="${VIM_PLUGIN_VIM_VERSION:-7.3}"
@@ -33,37 +39,9 @@ SLOT="0"
 # * installs all files in "${ED}"/usr/share/vim/vimfiles.
 vim-plugin_src_install() {
        has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
-       local f
-
-       # When globbing, if nothing exists, the shell literally returns the glob
-       # pattern. So turn on nullglob and extglob options to avoid this.
-       eshopts_push -s extglob
-       eshopts_push -s nullglob
-
-       ebegin "Cleaning up unwanted files and directories"
-       # We're looking for dotfiles, dotdirectories and Makefiles here.
-       local obj
-       eval "local matches=(@(.[^.]|.??*|Makefile*))"
-       for obj in "${matches[@]}"; do
-               rm -rv "${obj}" || die "cannot remove ${obj}"
-       done
-       eend $?
-
-       # Turn those options back off.
-       eshopts_pop
-       eshopts_pop
 
        # Install non-vim-help-docs
-       cd "${S}" || die "couldn't cd in ${S}"
-       local f
-       for f in *; do
-               [[ -f "${f}" ]] || continue
-               if [[ "${f}" = *.html ]]; then
-                       dohtml "${f}"
-               else
-                       dodoc "${f}"
-               fi
-       done
+       einstalldocs
 
        # Install remainder of plugin
        insinto /usr/share/vim/vimfiles/

diff --git a/eclass/vim-spell.eclass b/eclass/vim-spell.eclass
index f762a6bfd31..baf77221bc9 100644
--- a/eclass/vim-spell.eclass
+++ b/eclass/vim-spell.eclass
@@ -119,9 +119,7 @@ vim-spell_src_install() {
                fi
        done
 
-       for f in README*; do
-               dodoc "${f}"
-       done
+       einstalldocs
 
        [[ -z "${had_spell_file}" ]] && die "Didn't install any spell files?"
 }

Reply via email to