diff options
author | Michał Górny <mgorny@gentoo.org> | 2019-04-28 08:08:59 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2019-04-28 10:41:58 +0200 |
commit | 60a9373d446c87fd2f3bbd7f4084cb1250065175 (patch) | |
tree | 5bbdab29d1a5c7a87b260b9eda9952300e3206ce /app-shells/bash-completion | |
parent | app-shells/bash-completion: EAPI 7, py3.7 in -9999 (diff) | |
download | gentoo-60a9373d446c87fd2f3bbd7f4084cb1250065175.tar.gz gentoo-60a9373d446c87fd2f3bbd7f4084cb1250065175.tar.bz2 gentoo-60a9373d446c87fd2f3bbd7f4084cb1250065175.zip |
app-shells/bash-completion: Refactor completion removal into a func
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'app-shells/bash-completion')
-rw-r--r-- | app-shells/bash-completion/bash-completion-9999.ebuild | 45 |
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 73e814b98813..73e95569c3b2 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 |