1 |
W dniu sob, 19.08.2017 o godzinie 14∶53 +0200, użytkownik Patrice |
2 |
Clement napisał: |
3 |
> --- |
4 |
> eclass/vim-spell.eclass | 37 +++++++++++++++++++++++-------------- |
5 |
> 1 file changed, 23 insertions(+), 14 deletions(-) |
6 |
> |
7 |
> diff --git a/eclass/vim-spell.eclass b/eclass/vim-spell.eclass |
8 |
> index 1b0f93c264d..8c1b6314ed8 100644 |
9 |
> --- a/eclass/vim-spell.eclass |
10 |
> +++ b/eclass/vim-spell.eclass |
11 |
> @@ -68,23 +68,34 @@ RDEPEND="${DEPEND}" |
12 |
> SRC_URI="mirror://gentoo/${P}.tar.bz2" |
13 |
> SLOT="0" |
14 |
> |
15 |
> -if [[ -z "${VIM_SPELL_CODE}" ]] ; then |
16 |
> - VIM_SPELL_CODE="${PN/vim-spell-/}" |
17 |
> -fi |
18 |
> +# @ECLASS-VARIABLE: DESCRIPTION |
19 |
> +# @DESCRIPTION: |
20 |
> +# Default DESCRIPTION for Vim spell ebuilds. |
21 |
> +: ${DESCRIPTION:="vim spell files: ${VIM_SPELL_LANGUAGE} (${VIM_SPELL_LOCALE})"} |
22 |
|
23 |
Wouldn't it be better to declare it after you default VIM_SPELL_*? |
24 |
|
25 |
Also, is VIM_SPELL_LANGUAGE documented? I don't see it. |
26 |
|
27 |
> |
28 |
> -DESCRIPTION="vim spell files: ${VIM_SPELL_LANGUAGE} (${VIM_SPELL_CODE})" |
29 |
> +# @ECLASS-VARIABLE: HOMEPAGE |
30 |
> +# @DESCRIPTION: |
31 |
> +# Default HOMEPAGE for Vim spell ebuilds. |
32 |
> +: ${HOMEPAGE:="https://www.vim.org"} |
33 |
> |
34 |
> -if [[ -z "${HOMEPAGE}" ]] ; then |
35 |
> - HOMEPAGE="http://www.vim.org/" |
36 |
> -fi |
37 |
> +# @ECLASS-VARIABLE: VIM_SPELL_LOCALE |
38 |
> +# @INTERNAL |
39 |
|
40 |
Is it really internal? It looks like something that the ebuild might |
41 |
override in the past. |
42 |
|
43 |
> +# @DESCRIPTION: |
44 |
> +# Locale for the current ebuild. |
45 |
> +: ${VIM_SPELL_LOCALE:="${PN/vim-spell-/}"} |
46 |
> + |
47 |
> +# @ECLASS-VARIABLE: VIM_SPELL_DIRECTORY |
48 |
> +# @INTERNAL |
49 |
> +# @DESCRIPTION: |
50 |
> +# Path to Vim spell directory files. |
51 |
> +: ${VIM_SPELL_DIRECTORY:="/usr/share/vim/vimfiles/spell/"} |
52 |
> |
53 |
> # @FUNCTION: vim-spell_src_install |
54 |
> # @DESCRIPTION: |
55 |
> # Install Vim spell files. |
56 |
> vim-spell_src_install() { |
57 |
> - target="/usr/share/vim/vimfiles/spell/" |
58 |
> - dodir "${target}" |
59 |
> - insinto "${target}" |
60 |
> + dodir "${VIM_SPELL_DIRECTORY}" |
61 |
> + insinto "${VIM_SPELL_DIRECTORY}" |
62 |
> |
63 |
> had_spell_file= |
64 |
> for f in *.spl ; do |
65 |
> @@ -112,15 +123,13 @@ vim-spell_src_install() { |
66 |
> # Display installed Vim spell files. |
67 |
> vim-spell_pkg_postinst() { |
68 |
> has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}" |
69 |
> - target="/usr/share/vim/vimfiles/spell/" |
70 |
> echo |
71 |
> elog "To enable ${VIM_SPELL_LANGUAGE} spell checking, use" |
72 |
> - elog " :setlocal spell spelllang=${VIM_SPELL_CODE}" |
73 |
> + elog " :setlocal spell spelllang=${VIM_SPELL_LOCALE}" |
74 |
> echo |
75 |
> elog "The following (Vim internal, not file) encodings are supported for" |
76 |
> elog "this language:" |
77 |
> - for f in "${EROOT}/${target}/${VIM_SPELL_CODE}".*.spl ; do |
78 |
> - enc="${f##*/${VIM_SPELL_CODE}.}" |
79 |
> + for f in "${EROOT}/${VIM_SPELL_DIRECTORY}/${VIM_SPELL_LOCALE}".*.spl ; do enc="${f##*/${VIM_SPELL_LOCALE}.}" |
80 |
|
81 |
I suppose the combining of two lines was accidental. As a side note, |
82 |
EROOT ends with /. |
83 |
|
84 |
> enc="${enc%.spl}" |
85 |
> [[ -z "${enc}" ]] && continue |
86 |
> elog " ${enc}" |
87 |
|
88 |
-- |
89 |
Best regards, |
90 |
Michał Górny |