Subject: [PATCH 2/3] _apt: Complete releases by codename ('jessie', 'sid', etc).
From: Daniel Shahaf <[email-masked]>
To: [email-masked]
Date: Mon, 9 May 2016 22:16:03 +0000
List-Id: Zsh Workers List <zsh-workers.zsh.org>

---
 Completion/Debian/Command/_apt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt
index d6429cb..bde561a 100644
--- a/Completion/Debian/Command/_apt
+++ b/Completion/Debian/Command/_apt
@@ -592,8 +592,10 @@ _apt_releases_update () {
   if ( [[ ${+_apt_releases} -eq 0 ]] ||
       _cache_invalid APT_releases ) && ! _retrieve_cache APT_releases;
   then
+    local -a tmp=("${(f)$(apt-cache policy)}")
     _apt_releases=(
-${${${${(M)${(f)"$(apt-cache policy)"}:#*release*}#*a=}%%,*}:#now}
+${${${${(M)tmp:#*release*}#*a=}%%,*}:#now}
+${${${${(M)tmp:#*release*n=*}#*n=}%%,*}:#now}
     )
     typeset -U _apt_releases
     _store_cache APT_releases _apt_releases