[Pkg-zsh-devel] Bug#883158: Bug#883158: Bug#883158: zsh-common: no completion for "apt install /path/to/filename.deb"

Daniel Shahaf d.s at daniel.shahaf.name
Thu Nov 30 15:23:17 UTC 2017


Axel Beckert wrote on Thu, 30 Nov 2017 14:53 +0100:
> → apt install ./<Tab>
> \ 500\ http://ppa.launchpad.net/…/release/ubuntu\ yakkety/main\ amd64\ Packages
> \ \ \ \ \ release\ n=screen
> \ \ \ \ \ release\ n=zsh
> buildd-experimental
> buildd-sid
> buildd-unstable
> buster
> experimental
> experimental-debug
> rc-buggy-debug
> screen
> sid
> sid-debug
> stable
> testing
> unstable
> unstable-debug
> yakkety
> zsh
> 
> … even if there are a lot of .deb files in the current directory.
> 
> (The buggy part is the one with the lot of backslashes. Those seem
> lines from /etc/apt/prefences which are likely not correctly parsed.)

I can reproduce this.  For me the backslashed lines show the local-apt-
repository information from `apt-cache policy`'s output.  It's caused
by the `apt install hello/sid` completion logic (I can reproduce it with
'apt install hello/<TAB>').  This fixes it:

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

... although I wouldn't object to changing the patterns to «*[ ,]a=».



More information about the Pkg-zsh-devel mailing list