/[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.15 Revision 1.16
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.15 2007/05/14 20:04:07 pioto Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/vim-doc.eclass,v 1.16 2010/04/23 19:01:37 darkside 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="${ROOT}"/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 vim=$(type -P vim 2>/dev/null) 24 vim=$(type -P vim 2>/dev/null)
24 [[ -z "$vim" ]] && vim=$(type -P gvim 2>/dev/null) 25 [[ -z "$vim" ]] && vim=$(type -P gvim 2>/dev/null)
35 vim="${T}/tagvim" 36 vim="${T}/tagvim"
36 fi 37 fi
37 38
38 # Install the documentation symlinks into the versioned vim 39 # Install the documentation symlinks into the versioned vim
39 # directory and run :helptags 40 # directory and run :helptags
40 for d in "${ROOT}"/usr/share/vim/vim[0-9]*; do 41 for d in "${EROOT%/}"/usr/share/vim/vim[0-9]*; do
41 [[ -d "$d/doc" ]] || continue # catch a failed glob 42 [[ -d "$d/doc" ]] || continue # catch a failed glob
42 43
43 # Remove links, and possibly remove stale dirs 44 # Remove links, and possibly remove stale dirs
44 find $d/doc -name \*.txt -type l | while read s; do 45 find $d/doc -name \*.txt -type l | while read s; do
45 [[ $(readlink "$s") = $vimfiles/* ]] && rm -f "$s" 46 [[ $(readlink "$s") = $vimfiles/* ]] && rm -f "$s"

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20