Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] _apt: Fix completion of target_release names, e.g., 'apt install zsh/<TAB>'.



When local-apt-repository is installed, 'apt-cache policy' contains
.
     100 /var/lib/dpkg/status
         release a=now
     500 file:/var/lib/local-apt-repository ./ Packages
         release o=local-apt-repository,c=
.
which was matched by the pattern being patched.
---
 Completion/Debian/Command/_apt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt
index 074fb0164..aabe03d3c 100644
--- a/Completion/Debian/Command/_apt
+++ b/Completion/Debian/Command/_apt
@@ -609,7 +609,7 @@ _apt_releases_update () {
   then
     local -a tmp=("${(f)$(apt-cache policy)}")
     _apt_releases=(
-${${${${(M)tmp:#*release*}#*a=}%%,*}:#now}
+${${${${(M)tmp:#*release*a=*}#*a=}%%,*}:#now}
 ${${${${(M)tmp:#*release*n=*}#*n=}%%,*}:#now}
     )
     typeset -U _apt_releases



Messages sorted by: Reverse Date, Date, Thread, Author