Gentoo Archives: gentoo-commits

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