Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 210645
Collapse All | Expand All

(-)bash-completion.eclass.orig (-10 / +21 lines)
Lines 1-14 Link Here
1
# Copyright 1999-2005 Gentoo Foundation
1
# Copyright 1999-2008 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.16 2005/07/31 12:38:22 ka0ttic Exp $
3
# $Header: $
4
5
# @ECLASS: bash-completion.eclass
6
# @MAINTAINER:
7
# shell-tools@gentoo.org.
4
#
8
#
9
# Original author: Aaron Walker <ka0ttic@gentoo.org>
10
# @BLURB: An Interface for installing contributed bash-completion scripts
11
# @DESCRIPTION:
5
# Simple eclass that provides an interface for installing
12
# Simple eclass that provides an interface for installing
6
# contributed (ie not included in bash-completion proper)
13
# contributed (ie not included in bash-completion proper)
7
# bash-completion scripts.
14
# bash-completion scripts.
8
#
15
9
# Author: Aaron Walker <ka0ttic@gentoo.org>
16
# @ECLASS-VARIABLE: BASH_COMPLETION_NAME
10
#
17
# @DESCRIPTION:
11
# Please assign any bug reports to shell-tools@gentoo.org.
18
# Install the completion script with this name (see also dobashcompletion)
12
19
13
EXPORT_FUNCTIONS pkg_postinst
20
EXPORT_FUNCTIONS pkg_postinst
14
21
Lines 23-37 Link Here
23
			)
30
			)
24
		)"
31
		)"
25
32
26
# dobashcompletion <file> <new file>
33
# @FUNCTION: dobashcompletion
27
#	First arg, <file>, is required and is the location of the bash-completion
34
# @USAGE: < file > [ new_file ]
35
# @DESCRIPTION:
36
# First arg, <file>, is required and is the location of the bash-completion
28
# script to install.  If the variable BASH_COMPLETION_NAME is set in the
37
# script to install.  If the variable BASH_COMPLETION_NAME is set in the
29
# ebuild, dobashcompletion will install <file> as
38
# ebuild, dobashcompletion will install <file> as
30
# /usr/share/bash-completion/$BASH_COMPLETION_NAME. If it is not set,
39
# /usr/share/bash-completion/$BASH_COMPLETION_NAME. If it is not set,
31
# dobashcompletion will check if a second arg ($2) was passed, installing as
40
# dobashcompletion will check if a second arg [new_file] was passed, installing as
32
# the specified name.  Failing both these checks, dobashcompletion will
41
# the specified name.  Failing both these checks, dobashcompletion will
33
# install the file as /usr/share/bash-completion/${PN}.
42
# install the file as /usr/share/bash-completion/${PN}.
34
35
dobashcompletion() {
43
dobashcompletion() {
36
	[[ -z "$1" ]] && die "usage: dobashcompletion <file> <new file>"
44
	[[ -z "$1" ]] && die "usage: dobashcompletion <file> <new file>"
37
	[[ -z "${BASH_COMPLETION_NAME}" ]] && BASH_COMPLETION_NAME="${2:-${PN}}"
45
	[[ -z "${BASH_COMPLETION_NAME}" ]] && BASH_COMPLETION_NAME="${2:-${PN}}"
Lines 42-47 Link Here
42
	fi
50
	fi
43
}
51
}
44
52
53
# @FUNCTION: bash-completion_pkg_postinst
54
# @DESCRIPTION:
55
# The bash-completion pkg_postinst function, which is exported
45
bash-completion_pkg_postinst() {
56
bash-completion_pkg_postinst() {
46
	if useq bash-completion ; then
57
	if useq bash-completion ; then
47
		echo
58
		echo

Return to bug 210645