| 1 |
# Copyright 1999-2011 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: $
|
| 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 |
# @FUNCTION: dobashcomp
|
| 22 |
# @USAGE: file [...]
|
| 23 |
# @DESCRIPTION:
|
| 24 |
# Install bash-completion files passed as args. Has EAPI-dependant failure
|
| 25 |
# behavior (like doins).
|
| 26 |
dobashcomp() {
|
| 27 |
debug-print-function ${FUNCNAME} "${@}"
|
| 28 |
|
| 29 |
(
|
| 30 |
insinto /usr/share/bash-completion
|
| 31 |
doins "${@}"
|
| 32 |
)
|
| 33 |
}
|
| 34 |
|
| 35 |
# @FUNCTION: newbashcomp
|
| 36 |
# @USAGE: file newname
|
| 37 |
# @DESCRIPTION:
|
| 38 |
# Install bash-completion file under a new name. Has EAPI-dependant failure
|
| 39 |
# behavior (like newins).
|
| 40 |
newbashcomp() {
|
| 41 |
debug-print-function ${FUNCNAME} "${@}"
|
| 42 |
|
| 43 |
(
|
| 44 |
insinto /usr/share/bash-completion
|
| 45 |
newins "${@}"
|
| 46 |
)
|
| 47 |
}
|