1 |
commit: 60a9373d446c87fd2f3bbd7f4084cb1250065175 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 28 06:08:59 2019 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 28 08:41:58 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60a9373d |
7 |
|
8 |
app-shells/bash-completion: Refactor completion removal into a func |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
.../bash-completion/bash-completion-9999.ebuild | 45 +++++++++++----------- |
13 |
1 file changed, 22 insertions(+), 23 deletions(-) |
14 |
|
15 |
diff --git a/app-shells/bash-completion/bash-completion-9999.ebuild b/app-shells/bash-completion/bash-completion-9999.ebuild |
16 |
index 73e814b9881..73e95569c3b 100644 |
17 |
--- a/app-shells/bash-completion/bash-completion-9999.ebuild |
18 |
+++ b/app-shells/bash-completion/bash-completion-9999.ebuild |
19 |
@@ -36,27 +36,32 @@ DEPEND="app-arch/xz-utils |
20 |
)" |
21 |
PDEPEND=">=app-shells/gentoo-bashcomp-20140911" |
22 |
|
23 |
-# Remove unwanted completions. |
24 |
-STRIP_COMPLETIONS=( |
25 |
- # Slackware package stuff, quite generic names cause collisions |
26 |
- # (e.g. with sys-apps/pacman) |
27 |
- explodepkg installpkg makepkg pkgtool removepkg upgradepkg |
28 |
+strip_completions() { |
29 |
+ # Remove unwanted completions. |
30 |
+ local strip_completions=( |
31 |
+ # Slackware package stuff, quite generic names cause collisions |
32 |
+ # (e.g. with sys-apps/pacman) |
33 |
+ explodepkg installpkg makepkg pkgtool removepkg upgradepkg |
34 |
|
35 |
- # Debian/Red Hat network stuff |
36 |
- ifdown ifup ifstatus |
37 |
+ # Debian/Red Hat network stuff |
38 |
+ ifdown ifup ifstatus |
39 |
|
40 |
- # Installed in app-editors/vim-core |
41 |
- xxd |
42 |
+ # Installed in app-editors/vim-core |
43 |
+ xxd |
44 |
|
45 |
- # Now-dead symlinks to deprecated completions |
46 |
- hd ncal |
47 |
+ # Now-dead symlinks to deprecated completions |
48 |
+ hd ncal |
49 |
+ ) |
50 |
|
51 |
- # Installed by sys-apps/util-linux-2.28 (and now deprecated) |
52 |
- _mount _umount _mount.linux _umount.linux |
53 |
+ local file |
54 |
+ for file in "${strip_completions[@]}"; do |
55 |
+ rm "${ED}"/usr/share/bash-completion/completions/${file} || |
56 |
+ die "stripping ${file} failed" |
57 |
+ done |
58 |
|
59 |
- # Deprecated in favor of sys-apps/util-linux-2.31 |
60 |
- _rfkill |
61 |
-) |
62 |
+ # remove deprecated completions (moved to other packages) |
63 |
+ rm "${ED}"/usr/share/bash-completion/completions/_* || die |
64 |
+} |
65 |
|
66 |
python_check_deps() { |
67 |
has_version "dev-python/pexpect[${PYTHON_USEDEP}]" && |
68 |
@@ -104,13 +109,7 @@ src_install() { |
69 |
|
70 |
emake DESTDIR="${D}" profiledir="${EPREFIX}"/etc/bash/bashrc.d install |
71 |
|
72 |
- local file |
73 |
- for file in "${STRIP_COMPLETIONS[@]}"; do |
74 |
- rm "${ED}"/usr/share/bash-completion/completions/${file} || |
75 |
- die "stripping ${file} failed" |
76 |
- done |
77 |
- # remove deprecated completions (moved to other packages) |
78 |
- rm "${ED}"/usr/share/bash-completion/completions/_* || die |
79 |
+ strip_completions |
80 |
|
81 |
dodoc AUTHORS CHANGES CONTRIBUTING.md README.md |