From 7935b1613a105303288d037811c2bea5a5468822 Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 17 Sep 2013 22:27:15 +0800 Subject: [PATCH] __fish_print_packages: ignore errors, do less manipulation Closes #479 by piping STDERR to /dev/null. Also does much less manipulation of the package list; there are no packages in any of the archives containing the names that are stripped out as far as I can see. --- share/functions/__fish_print_packages.fish | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/share/functions/__fish_print_packages.fish b/share/functions/__fish_print_packages.fish index 96d1a6ed8..decf410df 100644 --- a/share/functions/__fish_print_packages.fish +++ b/share/functions/__fish_print_packages.fish @@ -13,12 +13,9 @@ function __fish_print_packages set -l package (_ Package) if type -f apt-cache >/dev/null - # Apply the following filters to output of apt-cache: - # 1) Remove package names with parentesis in them, since these seem to not correspond to actual packages as reported by rpm - # 2) Remove package names that are .so files, since these seem to not correspond to actual packages as reported by rpm - # 3) Remove path information such as /usr/bin/, as rpm packages do not have paths - - apt-cache --no-generate pkgnames (commandline -tc)|sgrep -v \( |sgrep -v '\.so\(\.[0-9]\)*$'|sed -e 's/\/.*\///'|sed -e 's/$/'\t$package'/' + # Do not generate the cache as apparently sometimes this is slow. + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547550 + apt-cache --no-generate pkgnames (commandline -tc) ^/dev/null | sed -e 's/$/'\t$package'/' return end