Package: apt-show-versions
Version: 0.17
Severity: minor
Tags: patch

The bash-completion of apt-show-version only works after dpkg completion has
been attempted.

This is the same problem as #658773 and #658669.
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=658773#25 contains a solution
for this.)

But that solution (using only installed packages) is (IMHO) not the best,
attached is a patch for showing all packages.
(I borrowed the line from the "apt-get install" completion ;-) )



-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (900, 'testing'), (900, 'stable'), (600, 'unstable'), (100,
'proposed-updates'), (100, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages apt-show-versions depends on:
ii  apt                      0.8.15.10
ii  libapt-pkg-perl          0.1.25+b1
ii  perl [libstorable-perl]  5.14.2-9

apt-show-versions recommends no packages.

apt-show-versions suggests no packages.

-- Configuration Files:
/etc/bash_completion.d/apt-show-versions changed [not included] (see patch)
--- orig/apt-show-versions	2009-06-19 00:00:00.000000000 +0200
+++ /etc/bash_completion.d/apt-show-versions	2012-03-18 02:21:04.794074335 +0100
@@ -27,7 +27,7 @@
             return 0
             ;;
         -p|--package)
-            COMPREPLY=( $(_comp_dpkg_installed_packages $cur) )
+            COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" 2> /dev/null ) )
             return 0
             ;;
         -stf|--status-file)
@@ -44,7 +44,7 @@
         COMPREPLY=( $(compgen -W "$opts" -- $cur) )
         return 0
     else
-        COMPREPLY=( $(_comp_dpkg_installed_packages $cur) )
+        COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" 2> /dev/null ) )
         return 0
     fi
 }

Reply via email to