diff options
author | Anna Vyalkova <cyber+gentoo@sysrq.in> | 2022-04-06 16:23:30 +0500 |
---|---|---|
committer | Patrice Clement <monsieurp@gentoo.org> | 2022-05-30 14:57:02 +0200 |
commit | d628b5aa6bb21ad255c0c67466f24e571471e169 (patch) | |
tree | 08b73411a3d216d1321e2b1de30beed544d3bb5c /eclass/vim-plugin.eclass | |
parent | vim-plugin.eclass: support EAPI 8 (diff) | |
download | gentoo-d628b5aa6bb21ad255c0c67466f24e571471e169.tar.gz gentoo-d628b5aa6bb21ad255c0c67466f24e571471e169.tar.bz2 gentoo-d628b5aa6bb21ad255c0c67466f24e571471e169.zip |
vim-plugin.eclass: EAPI 8: install allowed dirs only
Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
Diffstat (limited to 'eclass/vim-plugin.eclass')
-rw-r--r-- | eclass/vim-plugin.eclass | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass index a457f3a037ae..0c323e0d09e7 100644 --- a/eclass/vim-plugin.eclass +++ b/eclass/vim-plugin.eclass @@ -32,13 +32,30 @@ if [[ ${PV} != 9999* ]] ; then fi SLOT="0" +# @ECLASS_VARIABLE: _VIM_PLUGIN_ALLOWED_DIRS +# @INTERNAL +# @DESCRIPTION: +# Vanilla Vim dirs. +# See /usr/share/vim/vim* for reference. +_VIM_PLUGIN_ALLOWED_DIRS=( + after autoload colors compiler doc ftdetect ftplugin indent keymap + macros plugin spell syntax +) + # @FUNCTION: vim-plugin_src_install -# @USAGE: +# @USAGE: [<dir>...] # @DESCRIPTION: # Overrides the default src_install phase. In order, this function: -# * fixes file permission across all files in ${S}. # * installs help and documentation files. -# * installs all files in "${ED}"/usr/share/vim/vimfiles. +# * installs all files recognized by default Vim installation and directories +# passed to this function as arguments in "${ED}"/usr/share/vim/vimfiles. +# +# Example use: +# @CODE +# src_install() { +# vim-plugin_src_install syntax_checkers +# } +# @CODE vim-plugin_src_install() { # Install non-vim-help-docs einstalldocs @@ -46,10 +63,18 @@ vim-plugin_src_install() { # Install remainder of plugin insinto /usr/share/vim/vimfiles/ local d - for d in *; do - [[ -d "${d}" ]] || continue - doins -r "${d}" - done + case ${EAPI:-0} in + 6|7) + for d in *; do + [[ -d "${d}" ]] || continue + doins -r "${d}" + done ;; + *) + for d in "${_VIM_PLUGIN_ALLOWED_DIRS[@]}" "${@}"; do + [[ -d "${d}" ]] || continue + doins -r "${d}" + done ;; + esac } # @FUNCTION: vim-plugin_pkg_postinst |