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

Re: Bug#432036: _deb_packages: redirect apt-cache stderr to /dev/null



On Sat, Jul 07, 2007 at 12:06:00AM +0200, Vincent Lefevre wrote:
> /usr/share/zsh/4.3.4/functions/Completion/Debian/_deb_packages contains:
> 
>     _deb_packages_cache_avail=(
>       ${(f)"$(apt-cache --generate pkgnames)"}
>     )
> 
> However, when some source package list doesn't exist, apt-cache outputs
> warnings to stderr. In the completion code, these warnings go to the
> terminal. They should be filtered with "2> /dev/null":
> 
>     _deb_packages_cache_avail=(
>       ${(f)"$(apt-cache --generate pkgnames 2> /dev/null)"}
>     )

Index: Completion/Debian/Type/_deb_packages
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Debian/Type/_deb_packages,v
retrieving revision 1.6
diff -u -r1.6 _deb_packages
--- Completion/Debian/Type/_deb_packages	24 Apr 2005 17:49:53 -0000	1.6
+++ Completion/Debian/Type/_deb_packages	6 Jul 2007 23:50:16 -0000
@@ -7,7 +7,7 @@
       _cache_invalid DEBS_avail ) && ! _retrieve_cache DEBS_avail;
   then
     _deb_packages_cache_avail=(
-      ${(f)"$(apt-cache --generate pkgnames)"}
+      ${(f)"$(apt-cache --generate pkgnames 2>/dev/null)"}
     )
 
     _store_cache DEBS_avail _deb_packages_cache_avail



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