warn when directories found that hold shell completions.

This will warn then paths for certain shells that have completions are
found and tell the user to add a subpackage for it.

In a future date we also want to warn the user to move certain
directories where packages have completions to those directories so our
default_ functions can move them without problems
This commit is contained in:
Leo 2020-01-28 11:33:51 +01:00 committed by Natanael Copa
parent 77922d5c41
commit 2151c7af80
1 changed files with 14 additions and 1 deletions

View File

@ -838,6 +838,19 @@ prepare_subpackages() {
warning "Found /usr/share/locale"
warning2 "Maybe add \$pkgname-lang to subpackages?"
fi
# post check for shell completions
if [ -d "$pkgdir"/usr/share/bash-completion ]; then
warning "Found /usr/share/bash-completion"
warning2 "Add \$pkgname-bash-completion to subpackages"
fi
if [ -d "$pkgdir"/usr/share/zsh/site-functions ]; then
warning "Found /usr/share/zsh/site-functions"
warning2 "Add \$pkgname-zsh-completion to subpackages"
fi
if [ -d "$pkgdir"/usr/share/fish/completions ]; then
warning "Found /usr/share/fish/completions"
warning2 "Add \$pkgname-fish-completion to subpackages"
fi
}
default_lang() {
@ -1923,7 +1936,7 @@ default_bashcomp() {
install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
cd "$pkgdir" || return 0
amove /usr/share/bash-completion/completions
amove usr/share/bash-completion/completions
}
bashcomp() {