Gentoo Archives: gentoo-dev

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