/[gentoo-x86]/eclass/bash-completion-r1.eclass
Gentoo

Diff of /eclass/bash-completion-r1.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.7 Revision 1.10
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 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/bash-completion-r1.eclass,v 1.7 2013/07/22 11:38:59 ssuominen Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/bash-completion-r1.eclass,v 1.10 2013/09/10 19:12:17 ssuominen Exp $
4 4
5# @ECLASS: bash-completion-r1.eclass 5# @ECLASS: bash-completion-r1.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# mgorny@gentoo.org 7# mgorny@gentoo.org
8# @BLURB: A few quick functions to install bash-completion files 8# @BLURB: A few quick functions to install bash-completion files
39# _bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion/completions 39# _bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion/completions
40_bash-completion-r1_get_bashdir() { 40_bash-completion-r1_get_bashdir() {
41 debug-print-function ${FUNCNAME} "${@}" 41 debug-print-function ${FUNCNAME} "${@}"
42 42
43 if $(tc-getPKG_CONFIG) --exists bash-completion; then 43 if $(tc-getPKG_CONFIG) --exists bash-completion; then
44 echo "$($(tc-getPKG_CONFIG) --variable=$1 bash-completion)" 44 local path="$($(tc-getPKG_CONFIG) --variable=$1 bash-completion)"
45 # we need to return unprefixed, so strip from what pkg-config returns
46 # to us, bug #477692
47 echo "${path#${EPREFIX}}"
45 else 48 else
46 echo $2 49 echo $2
47 fi 50 fi
48} 51}
49 52
52# @DESCRIPTION: 55# @DESCRIPTION:
53# Get unprefixed bash-completion completions directory. 56# Get unprefixed bash-completion completions directory.
54_bash-completion-r1_get_bashcompdir() { 57_bash-completion-r1_get_bashcompdir() {
55 debug-print-function ${FUNCNAME} "${@}" 58 debug-print-function ${FUNCNAME} "${@}"
56 59
57 if has_version '<app-shells/bash-completion-2.1-r1'; then 60 if has_version '>=app-shells/bash-completion-2.1-r1'; then
61 _bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion/completions
62 else
58 _bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion 63 _bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion
59 else
60 _bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion/completions
61 fi 64 fi
62} 65}
63 66
64# @FUNCTION: _bash-completion-r1_get_helpersdir 67# @FUNCTION: _bash-completion-r1_get_helpersdir
65# @INTERNAL 68# @INTERNAL
75# @DESCRIPTION: 78# @DESCRIPTION:
76# Get the bash-completion completions directory. 79# Get the bash-completion completions directory.
77get_bashcompdir() { 80get_bashcompdir() {
78 debug-print-function ${FUNCNAME} "${@}" 81 debug-print-function ${FUNCNAME} "${@}"
79 82
80 echo "$(_bash-completion-r1_get_bashcompdir)" 83 echo "${EPREFIX}$(_bash-completion-r1_get_bashcompdir)"
81} 84}
82 85
83# @FUNCTION: get_bashhelpersdir 86# @FUNCTION: get_bashhelpersdir
84# @INTERNAL 87# @INTERNAL
85# @DESCRIPTION: 88# @DESCRIPTION:
86# Get the bash-completion helpers directory. 89# Get the bash-completion helpers directory.
87get_bashhelpersdir() { 90get_bashhelpersdir() {
88 debug-print-function ${FUNCNAME} "${@}" 91 debug-print-function ${FUNCNAME} "${@}"
89 92
90 echo "$(_bash-completion-r1_get_bashhelpersdir)" 93 echo "${EPREFIX}$(_bash-completion-r1_get_bashhelpersdir)"
91} 94}
92 95
93# @FUNCTION: dobashcomp 96# @FUNCTION: dobashcomp
94# @USAGE: file [...] 97# @USAGE: file [...]
95# @DESCRIPTION: 98# @DESCRIPTION:

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20