1 |
commit: fe9c1da03285a060f8e9f669a6d6bef0b6421de1 |
2 |
Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 22 15:45:32 2017 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 22 16:47:16 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe9c1da0 |
7 |
|
8 |
vim-plugin.eclass: document functions. |
9 |
|
10 |
eclass/vim-plugin.eclass | 35 ++++++++++++++++++++++++++++------- |
11 |
1 file changed, 28 insertions(+), 7 deletions(-) |
12 |
|
13 |
diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass |
14 |
index cdc24a15cf6..cbf71e2917a 100644 |
15 |
--- a/eclass/vim-plugin.eclass |
16 |
+++ b/eclass/vim-plugin.eclass |
17 |
@@ -25,6 +25,12 @@ if [[ ${PV} != 9999* ]] ; then |
18 |
fi |
19 |
SLOT="0" |
20 |
|
21 |
+# @FUNCTION: vim-plugin_src_install |
22 |
+# @DESCRIPTION: |
23 |
+# Overrides the default src_install phase. In order, this function: |
24 |
+# * fixes file permission across all files in ${S}. |
25 |
+# * installs help and documentation files. |
26 |
+# * installs all files in "${ED}"/usr/share/vim/vimfiles. |
27 |
vim-plugin_src_install() { |
28 |
has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}" |
29 |
local f |
30 |
@@ -66,12 +72,24 @@ vim-plugin_src_install() { |
31 |
chmod -R -x+X "${ED}"/usr/share/vim/vimfiles/ || die "chmod failed" |
32 |
} |
33 |
|
34 |
+# @FUNCTION: vim-plugin_pkg_postinst |
35 |
+# @DESCRIPTION: |
36 |
+# Overrides the pkg_postinst phase for this eclass. |
37 |
+# The following functions are called: |
38 |
+# * update_vim_helptags |
39 |
+# * update_vim_afterscripts |
40 |
+# * display_vim_plugin_help |
41 |
vim-plugin_pkg_postinst() { |
42 |
update_vim_helptags # from vim-doc |
43 |
update_vim_afterscripts # see below |
44 |
display_vim_plugin_help # see below |
45 |
} |
46 |
|
47 |
+# @FUNCTION: vim-plugin_pkg_postrm |
48 |
+# @DESCRIPTION: |
49 |
+# Overrides the pkg_postrm phase for this eclass. |
50 |
+# This function calls the update_vim_helptags and update_vim_afterscripts |
51 |
+# functions and enventually removes a bunch of empty directories. |
52 |
vim-plugin_pkg_postrm() { |
53 |
has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= |
54 |
update_vim_helptags # from vim-doc |
55 |
@@ -82,9 +100,10 @@ vim-plugin_pkg_postrm() { |
56 |
find "${EPREFIX}/usr/share/vim/vimfiles" -depth -type d -exec rmdir {} \; 2>/dev/null |
57 |
} |
58 |
|
59 |
-# update_vim_afterscripts: create scripts in |
60 |
-# /usr/share/vim/vimfiles/after/* comprised of the snippets in |
61 |
-# /usr/share/vim/vimfiles/after/*/*.d |
62 |
+# @FUNCTION: update_vim_afterscripts |
63 |
+# @DESCRIPTION: |
64 |
+# Creates scripts in /usr/share/vim/vimfiles/after/* |
65 |
+# comprised of the snippets in /usr/share/vim/vimfiles/after/*/*.d |
66 |
update_vim_afterscripts() { |
67 |
has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}" |
68 |
has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= |
69 |
@@ -115,13 +134,15 @@ update_vim_afterscripts() { |
70 |
done |
71 |
} |
72 |
|
73 |
-# Display a message with the plugin's help file if one is available. Uses the |
74 |
+# @FUNCTION: display_vim_plugin_help |
75 |
+# @DESCRIPTION: |
76 |
+# Displays a message with the plugin's help file if one is available. Uses the |
77 |
# VIM_PLUGIN_HELPFILES env var. If multiple help files are available, they |
78 |
# should be separated by spaces. If no help files are available, but the env |
79 |
# var VIM_PLUGIN_HELPTEXT is set, that is displayed instead. Finally, if we |
80 |
-# have nothing else, display a link to VIM_PLUGIN_HELPURI. An extra message |
81 |
-# regarding enabling filetype plugins is displayed if VIM_PLUGIN_MESSAGES |
82 |
-# includes the word "filetype". |
83 |
+# have nothing else, this functions displays a link to VIM_PLUGIN_HELPURI. An |
84 |
+# extra message regarding enabling filetype plugins is displayed if |
85 |
+# VIM_PLUGIN_MESSAGES includes the word "filetype". |
86 |
display_vim_plugin_help() { |
87 |
local h |