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

Contents of /eclass/vim-doc.eclass

Parent Directory Parent Directory | Revision Log Revision Log


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

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

  ViewVC Help
Powered by ViewVC 1.1.20