commit:     94eb6d9e4fa2278284b8724d6f85712595930efc
Author:     Thomas Bracht Laumann Jespersen <t <AT> laumann <DOT> xyz>
AuthorDate: Tue Apr  5 19:59:18 2022 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Wed Apr  6 08:49:38 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94eb6d9e

vim-doc.eclass: support EAPI 8

Signed-off-by: Thomas Bracht Laumann Jespersen <t <AT> laumann.xyz>
Closes: https://github.com/gentoo/gentoo/pull/24928
Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>

 eclass/vim-doc.eclass | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/eclass/vim-doc.eclass b/eclass/vim-doc.eclass
index ba9d00f4f5e8..de28ddfdfee8 100644
--- a/eclass/vim-doc.eclass
+++ b/eclass/vim-doc.eclass
@@ -1,10 +1,10 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: vim-doc.eclass
 # @MAINTAINER:
 # [email protected]
-# @SUPPORTED_EAPIS: 6 7
+# @SUPPORTED_EAPIS: 6 7 8
 # @BLURB: Eclass for vim{,-plugin}.eclass to update documentation tags.
 # @DESCRIPTION:
 # This eclass is used by vim.eclass and vim-plugin.eclass to update
@@ -16,8 +16,8 @@
 # DEPEND in vim-plugin or by whatever version of vim is being
 # installed by the eclass.
 
-case ${EAPI:-0} in
-       [67]) ;;
+case ${EAPI} in
+       6|7|8) ;;
        *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
@@ -30,12 +30,12 @@ update_vim_helptags() {
        # This is where vim plugins are installed
        vimfiles="${EROOT}"/usr/share/vim/vimfiles
 
-       if [[ $PN != vim-core ]]; then
+       if [[ ${PN} != vim-core ]]; then
                # Find a suitable vim binary for updating tags :helptags
                vim=$(type -P vim 2>/dev/null)
-               [[ -z "$vim" ]] && vim=$(type -P gvim 2>/dev/null)
-               [[ -z "$vim" ]] && vim=$(type -P kvim 2>/dev/null)
-               if [[ -z "$vim" ]]; then
+               [[ -z "${vim}" ]] && vim=$(type -P gvim 2>/dev/null)
+               [[ -z "${vim}" ]] && vim=$(type -P kvim 2>/dev/null)
+               if [[ -z "${vim}" ]]; then
                        ewarn "No suitable vim binary to rebuild documentation 
tags"
                fi
        fi
@@ -50,32 +50,32 @@ update_vim_helptags() {
        # Install the documentation symlinks into the versioned vim
        # directory and run :helptags
        for d in "${EROOT%/}"/usr/share/vim/vim[0-9]*; do
-               [[ -d "$d/doc" ]] || continue   # catch a failed glob
+               [[ -d "${d}/doc" ]] || continue # catch a failed glob
 
                # Remove links, and possibly remove stale dirs
-               find $d/doc -name \*.txt -type l | while read s; do
-                       [[ $(readlink "$s") = $vimfiles/* ]] && rm -f "$s"
+               find ${d}/doc -name \*.txt -type l | while read s; do
+                       [[ $(readlink "${s}") = $vimfiles/* ]] && rm -f "${s}"
                done
-               if [[ -f "$d/doc/tags" && $(find "$d" | wc -l | tr -d ' ') = 3 
]]; then
+               if [[ -f "${d}/doc/tags" && $(find "${d}" | wc -l | tr -d ' ') 
= 3 ]]; then
                        # /usr/share/vim/vim61
                        # /usr/share/vim/vim61/doc
                        # /usr/share/vim/vim61/doc/tags
-                       einfo "Removing $d"
-                       rm -r "$d"
+                       einfo "Removing ${d}"
+                       rm -r "${d}"
                        continue
                fi
 
                # Re-create / install new links
-               if [[ -d $vimfiles/doc ]]; then
-                       ln -s $vimfiles/doc/*.txt $d/doc 2>/dev/null
+               if [[ -d "${vimfiles}"/doc ]]; then
+                       ln -s "${vimfiles}"/doc/*.txt "${d}/doc" 2>/dev/null
                fi
 
                # Update tags; need a vim binary for this
-               if [[ -n "$vim" ]]; then
-                       einfo "Updating documentation tags in $d"
-                       DISPLAY= $vim -u NONE -U NONE -T xterm -X -n -f \
+               if [[ -n "${vim}" ]]; then
+                       einfo "Updating documentation tags in ${d}"
+                       DISPLAY= "${vim}" -u NONE -U NONE -T xterm -X -n -f \
                                '+set nobackup nomore' \
-                               "+helptags $d/doc" \
+                               "+helptags ${d}/doc" \
                                '+qa!' </dev/null &>/dev/null
                fi
        done

Reply via email to