eclass/bash-completion-r1: Sync with gentoo

It's from gentoo commit d9e60f491cb9ad6e0bf3328a027e30d8389b2553.
This commit is contained in:
Krzesimir Nowak 2021-11-05 20:15:40 +01:00
parent a8e33c92a4
commit 87d3be7e89

View File

@ -1,15 +1,15 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: bash-completion-r1.eclass
# @MAINTAINER:
# mgorny@gentoo.org
# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
# @SUPPORTED_EAPIS: 5 6 7 8
# @BLURB: A few quick functions to install bash-completion files
# @EXAMPLE:
#
# @CODE
# EAPI=5
# EAPI=8
#
# src_configure() {
# econf \
@ -23,11 +23,14 @@
# }
# @CODE
if [[ ! ${_BASH_COMPLETION_R1_ECLASS} ]]; then
_BASH_COMPLETION_R1_ECLASS=1
inherit toolchain-funcs
case ${EAPI:-0} in
0|1|2|3|4|5|6|7) ;;
*) die "EAPI ${EAPI} unsupported (yet)."
case ${EAPI} in
5|6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
# @FUNCTION: _bash-completion-r1_get_bashdir
@ -91,9 +94,9 @@ get_bashhelpersdir() {
}
# @FUNCTION: dobashcomp
# @USAGE: file [...]
# @USAGE: <file> [...]
# @DESCRIPTION:
# Install bash-completion files passed as args. Has EAPI-dependant failure
# Install bash-completion files passed as args. Has EAPI-dependent failure
# behavior (like doins).
dobashcomp() {
debug-print-function ${FUNCNAME} "${@}"
@ -106,9 +109,9 @@ dobashcomp() {
}
# @FUNCTION: newbashcomp
# @USAGE: file newname
# @USAGE: <file> <newname>
# @DESCRIPTION:
# Install bash-completion file under a new name. Has EAPI-dependant failure
# Install bash-completion file under a new name. Has EAPI-dependent failure
# behavior (like newins).
newbashcomp() {
debug-print-function ${FUNCNAME} "${@}"
@ -136,3 +139,5 @@ bashcomp_alias() {
|| return
done
}
fi