1 |
commit: 2624d89c0e221fa5acd9a5202cfd8e1a5c2922fe |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Mar 26 17:28:05 2022 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Mar 26 17:28:05 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/lisp.git/commit/?id=2624d89c |
7 |
|
8 |
bash-completion-r1.eclass: Remove |
9 |
|
10 |
This is an outdated copy of the eclass in the gentoo repository. |
11 |
|
12 |
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> |
13 |
|
14 |
eclass/bash-completion-r1.eclass | 135 --------------------------------------- |
15 |
1 file changed, 135 deletions(-) |
16 |
|
17 |
diff --git a/eclass/bash-completion-r1.eclass b/eclass/bash-completion-r1.eclass |
18 |
deleted file mode 100644 |
19 |
index eff5e68c..00000000 |
20 |
--- a/eclass/bash-completion-r1.eclass |
21 |
+++ /dev/null |
22 |
@@ -1,135 +0,0 @@ |
23 |
-# Copyright 1999-2018 Gentoo Foundation |
24 |
-# Distributed under the terms of the GNU General Public License v2 |
25 |
- |
26 |
-# @ECLASS: bash-completion-r1.eclass |
27 |
-# @MAINTAINER: |
28 |
-# mgorny@g.o |
29 |
-# @BLURB: A few quick functions to install bash-completion files |
30 |
-# @EXAMPLE: |
31 |
-# |
32 |
-# @CODE |
33 |
-# EAPI=5 |
34 |
-# |
35 |
-# src_configure() { |
36 |
-# econf \ |
37 |
-# --with-bash-completion-dir="$(get_bashcompdir)" |
38 |
-# } |
39 |
-# |
40 |
-# src_install() { |
41 |
-# default |
42 |
-# |
43 |
-# newbashcomp contrib/${PN}.bash-completion ${PN} |
44 |
-# } |
45 |
-# @CODE |
46 |
- |
47 |
-inherit toolchain-funcs |
48 |
- |
49 |
-case ${EAPI:-0} in |
50 |
- 0|1|2|3|4|5|6|7) ;; |
51 |
- *) die "EAPI ${EAPI} unsupported (yet)." |
52 |
-esac |
53 |
- |
54 |
-# @FUNCTION: _bash-completion-r1_get_bashdir |
55 |
-# @INTERNAL |
56 |
-# @DESCRIPTION: |
57 |
-# First argument is name of the string in bash-completion.pc |
58 |
-# Second argument is the fallback directory if the string is not found |
59 |
-# @EXAMPLE: |
60 |
-# _bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion |
61 |
-_bash-completion-r1_get_bashdir() { |
62 |
- debug-print-function ${FUNCNAME} "${@}" |
63 |
- |
64 |
- if $(tc-getPKG_CONFIG) --exists bash-completion &>/dev/null; then |
65 |
- local path |
66 |
- path=$($(tc-getPKG_CONFIG) --variable="${1}" bash-completion) || die |
67 |
- # we need to return unprefixed, so strip from what pkg-config returns |
68 |
- # to us, bug #477692 |
69 |
- echo "${path#${EPREFIX}}" |
70 |
- else |
71 |
- echo "${2}" |
72 |
- fi |
73 |
-} |
74 |
- |
75 |
-# @FUNCTION: _bash-completion-r1_get_bashcompdir |
76 |
-# @INTERNAL |
77 |
-# @DESCRIPTION: |
78 |
-# Get unprefixed bash-completion completions directory. |
79 |
-_bash-completion-r1_get_bashcompdir() { |
80 |
- debug-print-function ${FUNCNAME} "${@}" |
81 |
- |
82 |
- _bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion/completions |
83 |
-} |
84 |
- |
85 |
-# @FUNCTION: _bash-completion-r1_get_helpersdir |
86 |
-# @INTERNAL |
87 |
-# @DESCRIPTION: |
88 |
-# Get unprefixed bash-completion helpers directory. |
89 |
-_bash-completion-r1_get_bashhelpersdir() { |
90 |
- debug-print-function ${FUNCNAME} "${@}" |
91 |
- |
92 |
- _bash-completion-r1_get_bashdir helpersdir /usr/share/bash-completion/helpers |
93 |
-} |
94 |
- |
95 |
-# @FUNCTION: get_bashcompdir |
96 |
-# @DESCRIPTION: |
97 |
-# Get the bash-completion completions directory. |
98 |
-get_bashcompdir() { |
99 |
- debug-print-function ${FUNCNAME} "${@}" |
100 |
- |
101 |
- echo "${EPREFIX}$(_bash-completion-r1_get_bashcompdir)" |
102 |
-} |
103 |
- |
104 |
-# @FUNCTION: get_bashhelpersdir |
105 |
-# @INTERNAL |
106 |
-# @DESCRIPTION: |
107 |
-# Get the bash-completion helpers directory. |
108 |
-get_bashhelpersdir() { |
109 |
- debug-print-function ${FUNCNAME} "${@}" |
110 |
- |
111 |
- echo "${EPREFIX}$(_bash-completion-r1_get_bashhelpersdir)" |
112 |
-} |
113 |
- |
114 |
-# @FUNCTION: dobashcomp |
115 |
-# @USAGE: file [...] |
116 |
-# @DESCRIPTION: |
117 |
-# Install bash-completion files passed as args. Has EAPI-dependant failure |
118 |
-# behavior (like doins). |
119 |
-dobashcomp() { |
120 |
- debug-print-function ${FUNCNAME} "${@}" |
121 |
- |
122 |
- ( |
123 |
- insinto "$(_bash-completion-r1_get_bashcompdir)" |
124 |
- doins "${@}" |
125 |
- ) |
126 |
-} |
127 |
- |
128 |
-# @FUNCTION: newbashcomp |
129 |
-# @USAGE: file newname |
130 |
-# @DESCRIPTION: |
131 |
-# Install bash-completion file under a new name. Has EAPI-dependant failure |
132 |
-# behavior (like newins). |
133 |
-newbashcomp() { |
134 |
- debug-print-function ${FUNCNAME} "${@}" |
135 |
- |
136 |
- ( |
137 |
- insinto "$(_bash-completion-r1_get_bashcompdir)" |
138 |
- newins "${@}" |
139 |
- ) |
140 |
-} |
141 |
- |
142 |
-# @FUNCTION: bashcomp_alias |
143 |
-# @USAGE: <basename> <alias>... |
144 |
-# @DESCRIPTION: |
145 |
-# Alias <basename> completion to one or more commands (<alias>es). |
146 |
-bashcomp_alias() { |
147 |
- debug-print-function ${FUNCNAME} "${@}" |
148 |
- |
149 |
- [[ ${#} -lt 2 ]] && die "Usage: ${FUNCNAME} <basename> <alias>..." |
150 |
- local base=${1} f |
151 |
- shift |
152 |
- |
153 |
- for f; do |
154 |
- dosym "${base}" "$(_bash-completion-r1_get_bashcompdir)/${f}" \ |
155 |
- || return |
156 |
- done |
157 |
-} |