Gentoo Archives: gentoo-dev

From: Anna Vyalkova <cyber+gentoo@×××××.in>
To: gentoo-dev@l.g.o
Cc: vim@g.o
Subject: [gentoo-dev] [PATCH v4 3/9] vim-plugin.eclass: EAPI 8: install allowed dirs only
Date: Thu, 07 Apr 2022 12:02:56
Message-Id: 20220407120116.12893-4-cyber+gentoo@sysrq.in
In Reply to: [gentoo-dev] [PATCH v4 0/9] Vim eclasses by Anna Vyalkova
1 Signed-off-by: Anna Vyalkova <cyber+gentoo@×××××.in>
2 ---
3 eclass/vim-plugin.eclass | 39 ++++++++++++++++++++++++++++++++-------
4 1 file changed, 32 insertions(+), 7 deletions(-)
5
6 diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
7 index 0ee4ebe374..8a6a02f2d2 100644
8 --- a/eclass/vim-plugin.eclass
9 +++ b/eclass/vim-plugin.eclass
10 @@ -32,13 +32,30 @@ if [[ ${PV} != 9999* ]] ; then
11 fi
12 SLOT="0"
13
14 +# @ECLASS_VARIABLE: _VIM_PLUGIN_ALLOWED_DIRS
15 +# @INTERNAL
16 +# @DESCRIPTION:
17 +# Vanilla Vim dirs.
18 +# See /usr/share/vim/vim* for reference.
19 +_VIM_PLUGIN_ALLOWED_DIRS=(
20 + after autoload colors compiler doc ftdetect ftplugin indent keymap
21 + macros plugin spell syntax
22 +)
23 +
24 # @FUNCTION: vim-plugin_src_install
25 -# @USAGE:
26 +# @USAGE: [<dir>...]
27 # @DESCRIPTION:
28 # Overrides the default src_install phase. In order, this function:
29 -# * fixes file permission across all files in ${S}.
30 # * installs help and documentation files.
31 -# * installs all files in "${ED}"/usr/share/vim/vimfiles.
32 +# * installs all files recognized by default Vim installation and directories
33 +# passed to this function as arguments in "${ED}"/usr/share/vim/vimfiles.
34 +#
35 +# Example use:
36 +# @CODE
37 +# src_install() {
38 +# vim-plugin_src_install syntax_checkers
39 +# }
40 +# @CODE
41 vim-plugin_src_install() {
42
43 # Install non-vim-help-docs
44 @@ -47,10 +64,18 @@ vim-plugin_src_install() {
45 # Install remainder of plugin
46 insinto /usr/share/vim/vimfiles/
47 local d
48 - for d in *; do
49 - [[ -d "${d}" ]] || continue
50 - doins -r "${d}"
51 - done
52 + case ${EAPI:-0} in
53 + 6|7)
54 + for d in *; do
55 + [[ -d "${d}" ]] || continue
56 + doins -r "${d}"
57 + done ;;
58 + *)
59 + for d in "${_VIM_PLUGIN_ALLOWED_DIRS[@]}" "${@}"; do
60 + [[ -d "${d}" ]] || continue
61 + doins -r "${d}"
62 + done ;;
63 + esac
64 }
65
66 # @FUNCTION: vim-plugin_pkg_postinst
67 --
68 2.35.1