/[gentoo-x86]/eclass/vim-doc.eclass
Gentoo

Diff of /eclass/vim-doc.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1.1.1 Revision 1.17
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2011 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/vim-doc.eclass,v 1.1.1.1 2005/11/30 09:59:24 chriswhite Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/vim-doc.eclass,v 1.17 2011/12/27 17:55:12 fauli Exp $
4# 4#
5# This eclass is used by vim.eclass and vim-plugin.eclass to update 5# This eclass is used by vim.eclass and vim-plugin.eclass to update
6# the documentation tags. This is necessary since vim doesn't look in 6# the documentation tags. This is necessary since vim doesn't look in
7# /usr/share/vim/vimfiles/doc for documentation; it only uses the 7# /usr/share/vim/vimfiles/doc for documentation; it only uses the
8# versioned directory, for example /usr/share/vim/vim62/doc 8# versioned directory, for example /usr/share/vim/vim62/doc
11# DEPEND in vim-plugin or by whatever version of vim is being 11# DEPEND in vim-plugin or by whatever version of vim is being
12# installed by the eclass. 12# installed by the eclass.
13 13
14 14
15update_vim_helptags() { 15update_vim_helptags() {
16 has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
16 local vimfiles vim d s 17 local vimfiles vim d s
17 18
18 # This is where vim plugins are installed 19 # This is where vim plugins are installed
19 vimfiles=/usr/share/vim/vimfiles 20 vimfiles="${EROOT}"/usr/share/vim/vimfiles
20 21
21 if [[ $PN != vim-core ]]; then 22 if [[ $PN != vim-core ]]; then
22 # Find a suitable vim binary for updating tags :helptags 23 # Find a suitable vim binary for updating tags :helptags
23 if use ppc-macos ; then
24 vim=$(which gvim 2>/dev/null )
25 else
26 vim=$(which vim 2>/dev/null) 24 vim=$(type -P vim 2>/dev/null)
27 [[ -z "$vim" ]] && vim=$(which gvim 2>/dev/null) 25 [[ -z "$vim" ]] && vim=$(type -P gvim 2>/dev/null)
28 [[ -z "$vim" ]] && vim=$(which kvim 2>/dev/null) 26 [[ -z "$vim" ]] && vim=$(type -P kvim 2>/dev/null)
29 fi
30 if [[ -z "$vim" ]]; then 27 if [[ -z "$vim" ]]; then
31 ewarn "No suitable vim binary to rebuild documentation tags" 28 ewarn "No suitable vim binary to rebuild documentation tags"
32 fi 29 fi
33 fi 30 fi
34 31
32 # Make vim not try to connect to X. See :help gui-x11-start
33 # in vim for how this evil trickery works.
34 if [[ -n "${vim}" ]] ; then
35 ln -s "${vim}" "${T}/tagvim"
36 vim="${T}/tagvim"
37 fi
38
35 # Install the documentation symlinks into the versioned vim 39 # Install the documentation symlinks into the versioned vim
36 # directory and run :helptags 40 # directory and run :helptags
37 for d in /usr/share/vim/vim[0-9]*; do 41 for d in "${EROOT%/}"/usr/share/vim/vim[0-9]*; do
38 [[ -d "$d/doc" ]] || continue # catch a failed glob 42 [[ -d "$d/doc" ]] || continue # catch a failed glob
39 43
40 # Remove links, and possibly remove stale dirs 44 # Remove links, and possibly remove stale dirs
41 find $d/doc -name \*.txt -type l | while read s; do 45 find $d/doc -name \*.txt -type l | while read s; do
42 [[ $(readlink "$s") = $vimfiles/* ]] && rm -f "$s" 46 [[ $(readlink "$s") = $vimfiles/* ]] && rm -f "$s"
62 '+set nobackup nomore' \ 66 '+set nobackup nomore' \
63 "+helptags $d/doc" \ 67 "+helptags $d/doc" \
64 '+qa!' </dev/null &>/dev/null 68 '+qa!' </dev/null &>/dev/null
65 fi 69 fi
66 done 70 done
71
72 [[ -n "${vim}" && -f "${vim}" ]] && rm "${vim}"
67} 73}

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.20