summaryrefslogtreecommitdiff
path: root/eclass/vim-plugin.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-05-04 22:28:33 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-05-04 22:28:33 +0100
commita978c074e4272bb901fbe4a10de0a7b2af574f17 (patch)
tree8c764c1cc0576389ce22abd317bceba71ea5732d /eclass/vim-plugin.eclass
parent40aaaa64e86ba6710bbeb31c4615a6ce80e75e11 (diff)
gentoo resync : 04.05.2021
Diffstat (limited to 'eclass/vim-plugin.eclass')
-rw-r--r--eclass/vim-plugin.eclass54
1 files changed, 15 insertions, 39 deletions
diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
index a0ba714f6e6e..6b72d66111d3 100644
--- a/eclass/vim-plugin.eclass
+++ b/eclass/vim-plugin.eclass
@@ -1,9 +1,10 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: vim-plugin.eclass
# @MAINTAINER:
# vim@gentoo.org
+# @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,47 +39,17 @@ 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
- rm "${f}" || die
- done
+ einstalldocs
# Install remainder of plugin
- cd "${WORKDIR}" || die "couldn't cd in ${WORKDIR}"
- dodir /usr/share/vim
- mv "${S}" "${ED}"/usr/share/vim/vimfiles || die \
- "couldn't move ${S} to ${ED}/usr/share/vim/vimfiles"
-
- # Set permissions
- fperms -R a+rX /usr/share/vim/vimfiles
+ insinto /usr/share/vim/vimfiles/
+ local d
+ for d in *; do
+ [[ -d "${d}" ]] || continue
+ doins -r "${d}"
+ done
}
# @FUNCTION: vim-plugin_pkg_postinst