abuild: simplify shell completion checks

This commit is contained in:
Sertonix 2024-04-08 14:59:32 +02:00
parent 0e325a2354
commit 28c3912382
1 changed files with 6 additions and 24 deletions

View File

@ -590,15 +590,12 @@ subpkg_set() {
subpkgsplit=${_splitarch%%:*} subpkgsplit=${_splitarch%%:*}
if [ -z "$subpkgsplit" ]; then if [ -z "$subpkgsplit" ]; then
if is_bashcomp_pkg "$subpkgname"; then case $subpkgname in
subpkgsplit=bashcomp *-bash-completion) subpkgsplit=bashcomp ;;
elif is_zshcomp_pkg "$subpkgname"; then *-zsh-completion) subpkgsplit=zshcomp ;;
subpkgsplit=zshcomp *-fish-completion) subpkgsplit=fishcomp ;;
elif is_fishcomp_pkg "$subpkgname"; then *) subpkgsplit="${subpkgname##*-}" ;;
subpkgsplit=fishcomp esac
else
subpkgsplit="${subpkgname##*-}"
fi
fi fi
subpkgarch=${_splitarch#*:} subpkgarch=${_splitarch#*:}
@ -1382,21 +1379,6 @@ is_openrc_pkg() {
test "${1%-openrc}" != "$1" test "${1%-openrc}" != "$1"
} }
# returns true if this is the -bash-completion package
is_bashcomp_pkg() {
test "${1%-bash-completion}" != "$1"
}
# returns true if this is the -zsh-completion package
is_zshcomp_pkg() {
test "${1%-zsh-completion}" != "$1"
}
# returns true if this is the -fish-completion package
is_fishcomp_pkg() {
test "${1%-fish-completion}" != "$1"
}
# check that noarch is set if needed # check that noarch is set if needed
archcheck() { archcheck() {
options_has "!archcheck" && return 0 options_has "!archcheck" && return 0