/[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.3 Revision 1.4
1# Copyright 1999-2012 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.3 2012/09/27 16:35:41 axs Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/bash-completion-r1.eclass,v 1.4 2013/06/13 16:23:56 mgorny 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
21case ${EAPI:-0} in 21case ${EAPI:-0} in
22 0|1|2|3|4|5) ;; 22 0|1|2|3|4|5) ;;
23 *) die "EAPI ${EAPI} unsupported (yet)." 23 *) die "EAPI ${EAPI} unsupported (yet)."
24esac 24esac
25 25
26# @FUNCTION: _bash-completion-r1_get_bashcompdir
27# @INTERNAL
28# @DESCRIPTION:
29# Get unprefixed bash-completion directory.
30_bash-completion-r1_get_bashcompdir() {
31 debug-print-function ${FUNCNAME} "${@}"
32
33 echo /usr/share/bash-completion
34}
35
36# @FUNCTION: get_bashcompdir
37# @DESCRIPTION:
38# Get the bash-completion directory.
39get_bashcompdir() {
40 debug-print-function ${FUNCNAME} "${@}"
41
42 echo "${EPREFIX}$(_bash-completion-r1_get_bashcompdir)"
43}
44
26# @FUNCTION: dobashcomp 45# @FUNCTION: dobashcomp
27# @USAGE: file [...] 46# @USAGE: file [...]
28# @DESCRIPTION: 47# @DESCRIPTION:
29# Install bash-completion files passed as args. Has EAPI-dependant failure 48# Install bash-completion files passed as args. Has EAPI-dependant failure
30# behavior (like doins). 49# behavior (like doins).
31dobashcomp() { 50dobashcomp() {
32 debug-print-function ${FUNCNAME} "${@}" 51 debug-print-function ${FUNCNAME} "${@}"
33 52
34 ( 53 (
35 insinto /usr/share/bash-completion 54 insinto "$(_bash-completion-r1_get_bashcompdir)"
36 doins "${@}" 55 doins "${@}"
37 ) 56 )
38} 57}
39 58
40# @FUNCTION: newbashcomp 59# @FUNCTION: newbashcomp
44# behavior (like newins). 63# behavior (like newins).
45newbashcomp() { 64newbashcomp() {
46 debug-print-function ${FUNCNAME} "${@}" 65 debug-print-function ${FUNCNAME} "${@}"
47 66
48 ( 67 (
49 insinto /usr/share/bash-completion 68 insinto "$(_bash-completion-r1_get_bashcompdir)"
50 newins "${@}" 69 newins "${@}"
51 ) 70 )
52} 71}

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.20