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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Thu Jun 13 16:23:56 2013 UTC (17 months, 2 weeks ago) by mgorny
Branch: MAIN
Changes since 1.3: +23 -4 lines
Introduce get_bashcompdir(), wrt bug #469858.

1 # Copyright 1999-2013 Gentoo Foundation
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 $
4
5 # @ECLASS: bash-completion-r1.eclass
6 # @MAINTAINER:
7 # mgorny@gentoo.org
8 # @BLURB: A few quick functions to install bash-completion files
9 # @EXAMPLE:
10 #
11 # @CODE
12 # EAPI=4
13 #
14 # src_install() {
15 # default
16 #
17 # newbashcomp contrib/${PN}.bash-completion ${PN}
18 # }
19 # @CODE
20
21 case ${EAPI:-0} in
22 0|1|2|3|4|5) ;;
23 *) die "EAPI ${EAPI} unsupported (yet)."
24 esac
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.
39 get_bashcompdir() {
40 debug-print-function ${FUNCNAME} "${@}"
41
42 echo "${EPREFIX}$(_bash-completion-r1_get_bashcompdir)"
43 }
44
45 # @FUNCTION: dobashcomp
46 # @USAGE: file [...]
47 # @DESCRIPTION:
48 # Install bash-completion files passed as args. Has EAPI-dependant failure
49 # behavior (like doins).
50 dobashcomp() {
51 debug-print-function ${FUNCNAME} "${@}"
52
53 (
54 insinto "$(_bash-completion-r1_get_bashcompdir)"
55 doins "${@}"
56 )
57 }
58
59 # @FUNCTION: newbashcomp
60 # @USAGE: file newname
61 # @DESCRIPTION:
62 # Install bash-completion file under a new name. Has EAPI-dependant failure
63 # behavior (like newins).
64 newbashcomp() {
65 debug-print-function ${FUNCNAME} "${@}"
66
67 (
68 insinto "$(_bash-completion-r1_get_bashcompdir)"
69 newins "${@}"
70 )
71 }

  ViewVC Help
Powered by ViewVC 1.1.20