W dniu sob, 19.08.2017 o godzinie 14∶53 +0200, użytkownik Patrice
Clement napisał:
> ---
>  eclass/vim-spell.eclass | 37 +++++++++++++++++++++++--------------
>  1 file changed, 23 insertions(+), 14 deletions(-)
> 
> diff --git a/eclass/vim-spell.eclass b/eclass/vim-spell.eclass
> index 1b0f93c264d..8c1b6314ed8 100644
> --- a/eclass/vim-spell.eclass
> +++ b/eclass/vim-spell.eclass
> @@ -68,23 +68,34 @@ RDEPEND="${DEPEND}"
>  SRC_URI="mirror://gentoo/${P}.tar.bz2"
>  SLOT="0"
>  
> -if [[ -z "${VIM_SPELL_CODE}" ]] ; then
> -     VIM_SPELL_CODE="${PN/vim-spell-/}"
> -fi
> +# @ECLASS-VARIABLE: DESCRIPTION
> +# @DESCRIPTION:
> +# Default DESCRIPTION for Vim spell ebuilds.
> +: ${DESCRIPTION:="vim spell files: ${VIM_SPELL_LANGUAGE} 
> (${VIM_SPELL_LOCALE})"}

Wouldn't it be better to declare it after you default VIM_SPELL_*?

Also, is VIM_SPELL_LANGUAGE documented? I don't see it.

>  
> -DESCRIPTION="vim spell files: ${VIM_SPELL_LANGUAGE} (${VIM_SPELL_CODE})"
> +# @ECLASS-VARIABLE: HOMEPAGE
> +# @DESCRIPTION:
> +# Default HOMEPAGE for Vim spell ebuilds.
> +: ${HOMEPAGE:="https://www.vim.org"}
>  
> -if [[ -z "${HOMEPAGE}" ]] ; then
> -     HOMEPAGE="http://www.vim.org/";
> -fi
> +# @ECLASS-VARIABLE: VIM_SPELL_LOCALE
> +# @INTERNAL

Is it really internal? It looks like something that the ebuild might
override in the past.

> +# @DESCRIPTION:
> +# Locale for the current ebuild.
> +: ${VIM_SPELL_LOCALE:="${PN/vim-spell-/}"}
> +
> +# @ECLASS-VARIABLE: VIM_SPELL_DIRECTORY
> +# @INTERNAL
> +# @DESCRIPTION:
> +# Path to Vim spell directory files.
> +: ${VIM_SPELL_DIRECTORY:="/usr/share/vim/vimfiles/spell/"}
>  
>  # @FUNCTION: vim-spell_src_install
>  # @DESCRIPTION:
>  # Install Vim spell files.
>  vim-spell_src_install() {
> -     target="/usr/share/vim/vimfiles/spell/"
> -     dodir "${target}"
> -     insinto "${target}"
> +     dodir "${VIM_SPELL_DIRECTORY}"
> +     insinto "${VIM_SPELL_DIRECTORY}"
>  
>       had_spell_file=
>       for f in *.spl ; do
> @@ -112,15 +123,13 @@ vim-spell_src_install() {
>  # Display installed Vim spell files.
>  vim-spell_pkg_postinst() {
>       has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
> -     target="/usr/share/vim/vimfiles/spell/"
>       echo
>       elog "To enable ${VIM_SPELL_LANGUAGE} spell checking, use"
> -     elog "    :setlocal spell spelllang=${VIM_SPELL_CODE}"
> +     elog "    :setlocal spell spelllang=${VIM_SPELL_LOCALE}"
>       echo
>       elog "The following (Vim internal, not file) encodings are supported 
> for"
>       elog "this language:"
> -     for f in "${EROOT}/${target}/${VIM_SPELL_CODE}".*.spl ; do
> -             enc="${f##*/${VIM_SPELL_CODE}.}"
> +     for f in "${EROOT}/${VIM_SPELL_DIRECTORY}/${VIM_SPELL_LOCALE}".*.spl ; 
> do enc="${f##*/${VIM_SPELL_LOCALE}.}"

I suppose the combining of two lines was accidental. As a side note,
EROOT ends with /.

>               enc="${enc%.spl}"
>               [[ -z "${enc}" ]] && continue
>               elog "    ${enc}"

-- 
Best regards,
Michał Górny


Reply via email to