/[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.5 Revision 1.6
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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.5 2004/06/25 00:39:48 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/vim-doc.eclass,v 1.6 2005/02/03 21:12:41 agriffis 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
18 local vimfiles vim d s 18 local vimfiles vim d s
19 19
20 # This is where vim plugins are installed 20 # This is where vim plugins are installed
21 vimfiles=/usr/share/vim/vimfiles 21 vimfiles=/usr/share/vim/vimfiles
22 22
23 # Find a suitable vim binary 23 if [[ $PN != vim-core ]]; then
24 # Find a suitable vim binary for updating tags; try the graphical vims
25 # before stock vim because the system vim on macos doesn't support
26 # :helptags
24 local vim=`which vim 2>/dev/null` 27 vim=$(which gvim 2>/dev/null)
25 [[ -z "$vim" ]] && vim=`which gvim 2>/dev/null`
26 [[ -z "$vim" ]] && vim=`which kvim 2>/dev/null` 28 [[ -z "$vim" ]] && vim=$(which kvim 2>/dev/null)
27 if [[ -z "$vim" && $PN != vim-core ]]; then 29 [[ -z "$vim" ]] && vim=$(which vim 2>/dev/null)
30 if [[ -z "$vim" ]]; then
28 ewarn "No suitable vim binary to rebuild documentation tags" 31 ewarn "No suitable vim binary to rebuild documentation tags"
32 fi
33 if use ppc-macos && [[ "$vim" == vim ]]; then
34 ewarn "Sorry, the MacOS system-installed vim can't rebuild documentation tags"
35 fi
29 fi 36 fi
30 37
31 # Install the documentation symlinks into the versioned vim 38 # Install the documentation symlinks into the versioned vim
32 # directory and run :helptags 39 # directory and run :helptags
33 for d in /usr/share/vim/vim[0-9]*; do 40 for d in /usr/share/vim/vim[0-9]*; do
34 [[ -d "$d/doc" ]] || continue # catch a failed glob 41 [[ -d "$d/doc" ]] || continue # catch a failed glob
35 42
36 # Remove links, and possibly remove stale dirs 43 # Remove links, and possibly remove stale dirs
37 find $d/doc -name \*.txt -type l | while read s; do 44 find $d/doc -name \*.txt -type l | while read s; do
38 [[ `readlink "$s"` = $vimfiles/* ]] && rm -f "$s" 45 [[ $(readlink "$s") = $vimfiles/* ]] && rm -f "$s"
39 done 46 done
40 if [[ -f "$d/doc/tags" && $(find "$d" | wc -l | tr -d ' ') = 3 ]]; then 47 if [[ -f "$d/doc/tags" && $(find "$d" | wc -l | tr -d ' ') = 3 ]]; then
41 # /usr/share/vim/vim61 48 # /usr/share/vim/vim61
42 # /usr/share/vim/vim61/doc 49 # /usr/share/vim/vim61/doc
43 # /usr/share/vim/vim61/doc/tags 50 # /usr/share/vim/vim61/doc/tags

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20