/[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 Revision 1.2
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2003 Gentoo Technologies, Inc.
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 2003/07/30 18:47:06 agriffis Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/vim-doc.eclass,v 1.2 2003/07/30 18:53:54 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
22 22
23 # Find a suitable vim binary 23 # Find a suitable vim binary
24 local vim=`which vim 2>/dev/null` 24 local vim=`which vim 2>/dev/null`
25 [[ -z "$vim" ]] && vim=`which gvim 2>/dev/null` 25 [[ -z "$vim" ]] && vim=`which gvim 2>/dev/null`
26 [[ -z "$vim" ]] && vim=`which kvim 2>/dev/null` 26 [[ -z "$vim" ]] && vim=`which kvim 2>/dev/null`
27 if [[ -z "$vim" ]]; then 27 if [[ -z "$vim" -a $PN != vim-core ]]; then
28 ewarn "No suitable vim binary to rebuild documentation tags" 28 ewarn "No suitable vim binary to rebuild documentation tags"
29 fi 29 fi
30 30
31 # Install the documentation symlinks into the versioned vim 31 # Install the documentation symlinks into the versioned vim
32 # directory and run :helptags 32 # directory and run :helptags
33 for d in /usr/share/vim/vim[0-9]*; do 33 for d in /usr/share/vim/vim[0-9]*; do
34 [[ -d "$d/doc" ]] || continue # catch a failed glob 34 [[ -d "$d/doc" ]] || continue # catch a failed glob
35 35
36 # Remove links, and possibly remove stale dirs 36 # Remove links, and possibly remove stale dirs
37 find $d/doc -name \*.txt -type l | while read s; do 37 find $d/doc -name \*.txt -type l | while read s; do
38 [[ `readlink "$s"` = ${vimfiles}/* ]] && rm -f "$s" 38 [[ `readlink "$s"` = $vimfiles/* ]] && rm -f "$s"
39 done 39 done
40 if [[ -f "$d/doc/tags" && 40 if [[ -f "$d/doc/tags" &&
41 $(find "$d" | wc -l | awk '{print $1}') = 3 ]]; then 41 $(find "$d" | wc -l | awk '{print $1}') = 3 ]]; then
42 # /usr/share/vim/vim61 42 # /usr/share/vim/vim61
43 # /usr/share/vim/vim61/doc 43 # /usr/share/vim/vim61/doc
46 rm -r "$d" 46 rm -r "$d"
47 continue 47 continue
48 fi 48 fi
49 49
50 # Re-create / install new links 50 # Re-create / install new links
51 if [[ -d ${vimfiles}/doc ]]; then 51 if [[ -d $vimfiles/doc ]]; then
52 ln -s ${vimfiles}/doc/*.txt $d/doc 2>/dev/null 52 ln -s $vimfiles/doc/*.txt $d/doc 2>/dev/null
53 fi 53 fi
54 54
55 # Update tags; need a vim binary for this 55 # Update tags; need a vim binary for this
56 if [[ -n "$vim" ]]; then 56 if [[ -n "$vim" ]]; then
57 einfo "Updating documentation tags in $d" 57 einfo "Updating documentation tags in $d"

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.20