git » python-argcomplete.git » commit 23122e0

upgpkg: 3.1.1-3: include bash/zsh completions. fixes #2

author Felix Yan
2024-05-10 19:11:48 UTC
committer Felix Yan
2024-05-10 19:11:48 UTC
parent 2cd1a74bccba43b607225d2c43846a6c09bed18e

upgpkg: 3.1.1-3: include bash/zsh completions. fixes #2

.SRCINFO +1 -1
PKGBUILD +6 -1

diff --git a/.SRCINFO b/.SRCINFO
index 6d92a5c..458f860 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
 pkgbase = python-argcomplete
 	pkgdesc = Easy, extensible command line tab completion of arguments for your Python script
 	pkgver = 3.1.1
-	pkgrel = 2
+	pkgrel = 3
 	url = https://github.com/kislyuk/argcomplete
 	arch = any
 	license = Apache-2.0
diff --git a/PKGBUILD b/PKGBUILD
index 1082dfd..adfac33 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
 pkgname=python-argcomplete
 _pyname=argcomplete
 pkgver=3.1.1
-pkgrel=2
+pkgrel=3
 pkgdesc='Easy, extensible command line tab completion of arguments for your Python script'
 url='https://github.com/kislyuk/argcomplete'
 arch=('any')
@@ -42,6 +42,11 @@ check() {
 package() {
   cd ${_pyname}
   python -m installer --destdir="$pkgdir" dist/*.whl
+
+  local _site_packages=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
+  install -dm755 "$pkgdir"/usr/share/bash-completion/completions "$pkgdir"/usr/share/zsh/site-functions
+  ln -s ../../../..${_site_packages}/argcomplete/bash_completion.d/_python-argcomplete -t "$pkgdir"/usr/share/bash-completion/completions/
+  ln -s ../../../..${_site_packages}/argcomplete/bash_completion.d/_python-argcomplete -t "$pkgdir"/usr/share/zsh/site-functions/
 }
 
 # vim: ts=2 sw=2 et: