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

Contents of /eclass/bash-completion.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Sun Jan 2 11:56:08 2005 UTC (9 years, 8 months ago) by ka0ttic
Branch: MAIN
Changes since 1.7: +12 -20 lines
Added app-shells/bash-completion-config to RDEPEND.

1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/bash-completion.eclass,v 1.7 2004/12/30 00:18:25 ka0ttic Exp $
4 #
5 # Simple eclass that provides an interface for installing
6 # contributed (ie not included in bash-completion proper)
7 # bash-completion scripts.
8 #
9 # Author: Aaron Walker <ka0ttic@gentoo.org>
10 #
11 # Please assign any bug reports to shell-tools@gentoo.org.
12
13 ECLASS="bash-completion"
14 INHERITED="${INHERITED} ${ECLASS}"
15 EXPORT_FUNCTIONS pkg_postinst
16
17 IUSE="${IUSE} bash-completion"
18
19 RDEPEND="${RDEPEND}
20 bash-completion? ( app-shells/bash-completion-config )"
21
22 # dobashcompletion <file> <new file>
23 # First arg, <file>, is required and is the location of the bash-completion
24 # script to install. Second arg, <new file>, is optional and specifies an
25 # alternate filename to install as.
26
27 dobashcompletion() {
28 [[ -z "$1" ]] && die "usage: dobashcompletion <file> <new file>"
29 [[ -z "${BASH_COMPLETION_NAME}" ]] && BASH_COMPLETION_NAME="${2:-${PN}}"
30
31 if useq bash-completion ; then
32 insinto /usr/share/bash-completion
33 newins "$1" "${BASH_COMPLETION_NAME}" || die "Failed to install $1"
34 fi
35 }
36
37 bash-completion_pkg_postinst() {
38 if useq bash-completion ; then
39 echo
40 einfo "To enable command-line completion for ${PN}, run:"
41 einfo
42 einfo " bash-completion-config --install ${BASH_COMPLETION_NAME}"
43 einfo
44 einfo "to install locally, or"
45 einfo
46 einfo " bash-completion-config --global --install ${BASH_COMPLETION_NAME}"
47 einfo
48 einfo "to install system-wide."
49 einfo "Read bash-completion-config(1) for more information."
50 echo
51 fi
52 }

  ViewVC Help
Powered by ViewVC 1.1.20