Merge branch 'simpolify-completions' into 'master'

abuild: simplify shell completion checks

See merge request alpine/abuild!265
This commit is contained in:
Sertonix 2024-04-29 17:35:08 +00:00
commit 35c7a5bf82
1 changed files with 6 additions and 24 deletions

View File

@ -590,15 +590,12 @@ subpkg_set() {
subpkgsplit=${_splitarch%%:*}
if [ -z "$subpkgsplit" ]; then
if is_bashcomp_pkg "$subpkgname"; then
subpkgsplit=bashcomp
elif is_zshcomp_pkg "$subpkgname"; then
subpkgsplit=zshcomp
elif is_fishcomp_pkg "$subpkgname"; then
subpkgsplit=fishcomp
else
subpkgsplit="${subpkgname##*-}"
fi
case $subpkgname in
*-bash-completion) subpkgsplit=bashcomp ;;
*-zsh-completion) subpkgsplit=zshcomp ;;
*-fish-completion) subpkgsplit=fishcomp ;;
*) subpkgsplit="${subpkgname##*-}" ;;
esac
fi
subpkgarch=${_splitarch#*:}
@ -1389,21 +1386,6 @@ is_openrc_pkg() {
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
archcheck() {
options_has "!archcheck" && return 0