summaryrefslogtreecommitdiff
path: root/app-shells
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2019-04-28 08:08:59 +0200
committerMichał Górny <mgorny@gentoo.org>2019-04-28 10:41:58 +0200
commit60a9373d446c87fd2f3bbd7f4084cb1250065175 (patch)
tree5bbdab29d1a5c7a87b260b9eda9952300e3206ce /app-shells
parent749d297a1d51aea75e9a3f75cfe15c762aa7196a (diff)
downloadgentoo-60a9373d446c87fd2f3bbd7f4084cb1250065175.tar.gz
gentoo-60a9373d446c87fd2f3bbd7f4084cb1250065175.tar.xz
app-shells/bash-completion: Refactor completion removal into a func
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'app-shells')
-rw-r--r--app-shells/bash-completion/bash-completion-9999.ebuild45
1 files changed, 22 insertions, 23 deletions
diff --git a/app-shells/bash-completion/bash-completion-9999.ebuild b/app-shells/bash-completion/bash-completion-9999.ebuild
index 73e814b9881..73e95569c3b 100644
--- a/app-shells/bash-completion/bash-completion-9999.ebuild
+++ b/app-shells/bash-completion/bash-completion-9999.ebuild
@@ -36,27 +36,32 @@ DEPEND="app-arch/xz-utils
)"
PDEPEND=">=app-shells/gentoo-bashcomp-20140911"
-# Remove unwanted completions.
-STRIP_COMPLETIONS=(
- # Slackware package stuff, quite generic names cause collisions
- # (e.g. with sys-apps/pacman)
- explodepkg installpkg makepkg pkgtool removepkg upgradepkg
+strip_completions() {
+ # Remove unwanted completions.
+ local strip_completions=(
+ # Slackware package stuff, quite generic names cause collisions
+ # (e.g. with sys-apps/pacman)
+ explodepkg installpkg makepkg pkgtool removepkg upgradepkg
- # Debian/Red Hat network stuff
- ifdown ifup ifstatus
+ # Debian/Red Hat network stuff
+ ifdown ifup ifstatus
- # Installed in app-editors/vim-core
- xxd
+ # Installed in app-editors/vim-core
+ xxd
- # Now-dead symlinks to deprecated completions
- hd ncal
+ # Now-dead symlinks to deprecated completions
+ hd ncal
+ )
- # Installed by sys-apps/util-linux-2.28 (and now deprecated)
- _mount _umount _mount.linux _umount.linux
+ local file
+ for file in "${strip_completions[@]}"; do
+ rm "${ED}"/usr/share/bash-completion/completions/${file} ||
+ die "stripping ${file} failed"
+ done
- # Deprecated in favor of sys-apps/util-linux-2.31
- _rfkill
-)
+ # remove deprecated completions (moved to other packages)
+ rm "${ED}"/usr/share/bash-completion/completions/_* || die
+}
python_check_deps() {
has_version "dev-python/pexpect[${PYTHON_USEDEP}]" &&
@@ -104,13 +109,7 @@ src_install() {
emake DESTDIR="${D}" profiledir="${EPREFIX}"/etc/bash/bashrc.d install
- local file
- for file in "${STRIP_COMPLETIONS[@]}"; do
- rm "${ED}"/usr/share/bash-completion/completions/${file} ||
- die "stripping ${file} failed"
- done
- # remove deprecated completions (moved to other packages)
- rm "${ED}"/usr/share/bash-completion/completions/_* || die
+ strip_completions
dodoc AUTHORS CHANGES CONTRIBUTING.md README.md