summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /eclass/bash-completion.eclass
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'eclass/bash-completion.eclass')
-rw-r--r--eclass/bash-completion.eclass101
1 files changed, 101 insertions, 0 deletions
diff --git a/eclass/bash-completion.eclass b/eclass/bash-completion.eclass
new file mode 100644
index 000000000000..846e8c8e6345
--- /dev/null
+++ b/eclass/bash-completion.eclass
@@ -0,0 +1,101 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# DEPRECATED
+# This eclass has been superseded by bash-completion-r1 eclass.
+# Please modify your ebuilds to use that one instead.
+
+# @ECLASS: bash-completion.eclass
+# @MAINTAINER:
+# shell-tools@gentoo.org.
+# @AUTHOR:
+# Original author: Aaron Walker <ka0ttic@gentoo.org>
+# @BLURB: An Interface for installing contributed bash-completion scripts
+# @DESCRIPTION:
+# Simple eclass that provides an interface for installing
+# contributed (ie not included in bash-completion proper)
+# bash-completion scripts.
+#
+# Note: this eclass has been deprecated in favor of bash-completion-r1. Please
+# use that one instead.
+
+# @ECLASS-VARIABLE: BASHCOMPLETION_NAME
+# @DESCRIPTION:
+# Install the completion script with this name (see also dobashcompletion)
+
+# @ECLASS-VARIABLE: BASHCOMPFILES
+# @DESCRIPTION:
+# Space delimited list of files to install if dobashcompletion is called without
+# arguments.
+
+inherit eutils
+
+EXPORT_FUNCTIONS pkg_postinst
+
+IUSE="bash-completion"
+
+# Allow eclass to be inherited by eselect without a circular dependency
+if [[ ${CATEGORY}/${PN} != app-admin/eselect ]]; then
+ RDEPEND="bash-completion? ( app-admin/eselect )"
+fi
+PDEPEND="bash-completion? ( app-shells/bash-completion )"
+
+# @FUNCTION: dobashcompletion
+# @USAGE: [file] [new_file]
+# @DESCRIPTION:
+# The first argument is the location of the bash-completion script to install,
+# and is required if BASHCOMPFILES is not set. The second argument is the name
+# the script will be installed as. If BASHCOMPLETION_NAME is set, it overrides
+# the second argument. If no second argument is given and BASHCOMPLETION_NAME
+# is not set, it will default to ${PN}.
+dobashcompletion() {
+ local f
+
+ eqawarn "bash-completion.eclass has been deprecated."
+ eqawarn "Please update your ebuilds to use bash-completion-r1 instead."
+
+ if [[ -z ${1} && -z ${BASHCOMPFILES} ]]; then
+ die "Usage: dobashcompletion [file] [new file]"
+ fi
+
+ if use bash-completion; then
+ insinto /usr/share/bash-completion
+ if [[ -n ${1} ]]; then
+ [[ -z ${BASHCOMPLETION_NAME} ]] && BASHCOMPLETION_NAME="${2:-${PN}}"
+ newins "${1}" "${BASHCOMPLETION_NAME}" || die "Failed to install ${1}"
+ else
+ set -- ${BASHCOMPFILES}
+ for f in "$@"; do
+ if [[ -e ${f} ]]; then
+ doins "${f}" || die "Failed to install ${f}"
+ fi
+ done
+ fi
+ fi
+}
+
+# @FUNCTION: bash-completion_pkg_postinst
+# @DESCRIPTION:
+# The bash-completion pkg_postinst function, which is exported
+bash-completion_pkg_postinst() {
+ local f
+
+ if use bash-completion ; then
+ elog "The following bash-completion scripts have been installed:"
+ if [[ -n ${BASHCOMPLETION_NAME} ]]; then
+ elog " ${BASHCOMPLETION_NAME}"
+ else
+ set -- ${BASHCOMPFILES}
+ for f in "$@"; do
+ elog " $(basename ${f})"
+ done
+ fi
+ elog
+ elog "To enable command-line completion on a per-user basis run:"
+ elog " eselect bashcomp enable <script>"
+ elog
+ elog "To enable command-line completion system-wide run:"
+ elog " eselect bashcomp enable --global <script>"
+ fi
+}