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

Diff of /eclass/bash-completion.eclass

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

Revision 1.22 Revision 1.23
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2010 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.eclass,v 1.22 2009/12/31 15:57:04 ulm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/bash-completion.eclass,v 1.23 2010/01/02 00:07:46 ulm Exp $
4 4
5# @ECLASS: bash-completion.eclass 5# @ECLASS: bash-completion.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# shell-tools@gentoo.org. 7# shell-tools@gentoo.org.
8# 8#
23 23
24# Allow eclass to be inherited by eselect without a circular dependency 24# Allow eclass to be inherited by eselect without a circular dependency
25if [[ ${CATEGORY}/${PN} != app-admin/eselect ]]; then 25if [[ ${CATEGORY}/${PN} != app-admin/eselect ]]; then
26 RDEPEND="bash-completion? ( app-admin/eselect )" 26 RDEPEND="bash-completion? ( app-admin/eselect )"
27fi 27fi
28PDEPEND="bash-completion? ( app-shells/bash-completion )"
28 29
29# @FUNCTION: dobashcompletion 30# @FUNCTION: dobashcompletion
30# @USAGE: < file > [ new_file ] 31# @USAGE: < file > [ new_file ]
31# @DESCRIPTION: 32# @DESCRIPTION:
32# First arg, <file>, is required and is the location of the bash-completion 33# First arg, <file>, is required and is the location of the bash-completion
38# install the file as /usr/share/bash-completion/${PN}. 39# install the file as /usr/share/bash-completion/${PN}.
39dobashcompletion() { 40dobashcompletion() {
40 [[ -z "$1" ]] && die "usage: dobashcompletion <file> <new file>" 41 [[ -z "$1" ]] && die "usage: dobashcompletion <file> <new file>"
41 [[ -z "${BASH_COMPLETION_NAME}" ]] && BASH_COMPLETION_NAME="${2:-${PN}}" 42 [[ -z "${BASH_COMPLETION_NAME}" ]] && BASH_COMPLETION_NAME="${2:-${PN}}"
42 43
43 if useq bash-completion ; then 44 if use bash-completion ; then
44 insinto /usr/share/bash-completion 45 insinto /usr/share/bash-completion
45 newins "$1" "${BASH_COMPLETION_NAME}" || die "Failed to install $1" 46 newins "$1" "${BASH_COMPLETION_NAME}" || die "Failed to install $1"
46 fi 47 fi
47} 48}
48 49
49# @FUNCTION: bash-completion_pkg_postinst 50# @FUNCTION: bash-completion_pkg_postinst
50# @DESCRIPTION: 51# @DESCRIPTION:
51# The bash-completion pkg_postinst function, which is exported 52# The bash-completion pkg_postinst function, which is exported
52bash-completion_pkg_postinst() { 53bash-completion_pkg_postinst() {
53 if useq bash-completion ; then 54 if use bash-completion ; then
54 elog "In the case that you haven't yet enabled command-line completion" 55 elog "In the case that you haven't yet enabled command-line completion"
55 elog "for ${PN}, you can run:" 56 elog "for ${PN}, you can run:"
56 elog 57 elog
57 elog " eselect bashcomp enable ${BASH_COMPLETION_NAME:-${PN}}" 58 elog " eselect bashcomp enable ${BASH_COMPLETION_NAME:-${PN}}"
58 elog 59 elog

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

  ViewVC Help
Powered by ViewVC 1.1.20