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

Contents of /eclass/vim-doc.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (hide annotations) (download)
Wed Jul 6 20:20:04 2005 UTC (9 years ago) by agriffis
Branch: MAIN
Changes since 1.7: +1 -2 lines
Remove ECLASS= and INHERITED= which haven't been necessary for a long time now

1 vapier 1.5 # Copyright 1999-2004 Gentoo Foundation
2 agriffis 1.1 # Distributed under the terms of the GNU General Public License v2
3 agriffis 1.8 # $Header: /var/cvsroot/gentoo-x86/eclass/vim-doc.eclass,v 1.7 2005/02/18 19:11:02 ciaranm Exp $
4 agriffis 1.1 #
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
7     # /usr/share/vim/vimfiles/doc for documentation; it only uses the
8     # versioned directory, for example /usr/share/vim/vim62/doc
9     #
10     # We depend on vim being installed, which is satisfied by either the
11     # DEPEND in vim-plugin or by whatever version of vim is being
12     # installed by the eclass.
13    
14     INHERITED="$INHERITED $ECLASS"
15    
16     update_vim_helptags() {
17     local vimfiles vim d s
18    
19     # This is where vim plugins are installed
20     vimfiles=/usr/share/vim/vimfiles
21    
22 agriffis 1.6 if [[ $PN != vim-core ]]; then
23 ciaranm 1.7 # Find a suitable vim binary for updating tags :helptags
24     if use ppc-macos ; then
25     vim=$(which gvim 2>/dev/null )
26     else
27     vim=$(which vim 2>/dev/null)
28     [[ -z "$vim" ]] && vim=$(which gvim 2>/dev/null)
29     [[ -z "$vim" ]] && vim=$(which kvim 2>/dev/null)
30     fi
31 agriffis 1.6 if [[ -z "$vim" ]]; then
32     ewarn "No suitable vim binary to rebuild documentation tags"
33     fi
34 agriffis 1.1 fi
35    
36     # Install the documentation symlinks into the versioned vim
37     # directory and run :helptags
38     for d in /usr/share/vim/vim[0-9]*; do
39     [[ -d "$d/doc" ]] || continue # catch a failed glob
40    
41     # Remove links, and possibly remove stale dirs
42     find $d/doc -name \*.txt -type l | while read s; do
43 agriffis 1.6 [[ $(readlink "$s") = $vimfiles/* ]] && rm -f "$s"
44 agriffis 1.1 done
45 agriffis 1.4 if [[ -f "$d/doc/tags" && $(find "$d" | wc -l | tr -d ' ') = 3 ]]; then
46 agriffis 1.1 # /usr/share/vim/vim61
47     # /usr/share/vim/vim61/doc
48     # /usr/share/vim/vim61/doc/tags
49     einfo "Removing $d"
50     rm -r "$d"
51     continue
52     fi
53    
54     # Re-create / install new links
55 agriffis 1.2 if [[ -d $vimfiles/doc ]]; then
56     ln -s $vimfiles/doc/*.txt $d/doc 2>/dev/null
57 agriffis 1.1 fi
58    
59     # Update tags; need a vim binary for this
60     if [[ -n "$vim" ]]; then
61     einfo "Updating documentation tags in $d"
62     DISPLAY= $vim -u NONE -U NONE -T xterm -X -n -f \
63     '+set nobackup nomore' \
64     "+helptags $d/doc" \
65     '+qa!' </dev/null &>/dev/null
66     fi
67     done
68     }

  ViewVC Help
Powered by ViewVC 1.1.20