aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2019-11-10 13:05:50 +0100
committerJakub Jirutka <jakub@jirutka.cz>2019-11-10 13:11:36 +0100
commit710c323db8c250364b2f6880bb2c0afd87062835 (patch)
treeb058e380ea62b151045dcbdcf61614850597216b
parent8e132813499fcc12b076d675d2258625b7074b2e (diff)
downloadaports-710c323db8c250364b2f6880bb2c0afd87062835.tar.gz
aports-710c323db8c250364b2f6880bb2c0afd87062835.tar.bz2
aports-710c323db8c250364b2f6880bb2c0afd87062835.tar.xz
community/yash: move some bigger completions to separate subpackages
-rw-r--r--community/yash/APKBUILD31
1 files changed, 30 insertions, 1 deletions
diff --git a/community/yash/APKBUILD b/community/yash/APKBUILD
index 1cf22ca625..142d1153c2 100644
--- a/community/yash/APKBUILD
+++ b/community/yash/APKBUILD
@@ -10,9 +10,22 @@ license="GPL-2.0-or-later"
depends="$pkgname-completion"
makedepends="ncurses-dev"
install="$pkgname.post-install $pkgname.pre-deinstall"
-subpackages="$pkgname-completion::noarch $pkgname-doc"
+subpackages="$pkgname-doc"
source="https://github.com/magicant/yash/releases/download/$pkgver/yash-$pkgver.tar.xz"
+_compdir="usr/share/yash/completion"
+
+# Move some bigger completion files to separate subpackages.
+_comps="git:git:git[gkx]:git-*
+ openssh-client:ssh:ssh-*
+ subversion:svn
+ valgrind:valgrind
+ "
+for _i in $_comps; do
+ subpackages="$subpackages ${_i%%:*}-yash-completion:_completion:noarch"
+done
+subpackages="$subpackages $pkgname-completion::noarch"
+
prepare() {
default_prepare
@@ -45,6 +58,22 @@ package() {
rm -Rf "$pkgdir"/usr/share/man/ja
}
+_completion() {
+ local name="${subpkgname%-yash-completion}"
+ pkgdesc="Yash completions for $name"
+ depends="$pkgname-completion"
+ install_if="$pkgname-completion=$pkgver-r$pkgrel $name"
+
+ local files=$(printf '%s\n' $_comps \
+ | sed -En "s|^$name:(.*)|\1|p" \
+ | tr : ' ')
+ [ "$files" ] || die "$name not found in \$_comps"
+
+ local f; for f in $files; do
+ amove usr/share/yash/completion/$f
+ done
+}
+
completion() {
pkgdesc="$pkgdesc (command-line completion)"
depends=""