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

Re: Bug triage



On 2008-12-30 04:55:14 +0000, Clint Adams wrote:
> Index: Completion/Debian/Type/_deb_packages
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Completion/Debian/Type/_deb_packages,v
> retrieving revision 1.8
> diff -u -r1.8 _deb_packages
> --- Completion/Debian/Type/_deb_packages	2 Nov 2008 14:12:29 -0000	1.8
> +++ Completion/Debian/Type/_deb_packages	30 Dec 2008 04:54:18 -0000
> @@ -6,9 +6,11 @@
>    if ( [[ ${+_deb_packages_cache_avail} -eq 0 ]] ||
>        _cache_invalid DEBS_avail ) && ! _retrieve_cache DEBS_avail;
>    then
> -    _deb_packages_cache_avail=(
> +    if _deb_packages_cache_avail=(
>        ${(f)"$(apt-cache --generate pkgnames 2>/dev/null)"}
> -    )
> +    ); then
> +      unset _deb_packages_cache_avail
> +    fi
>  
>      _store_cache DEBS_avail _deb_packages_cache_avail
>    fi

With "dpkg -s lib[TAB]", the problem is with
_deb_packages_update_installed and the variable
_deb_packages_cache_installed, even though I suppose that the
other functions are affected by the same bug. Even if I add

  if [[ -z "$_deb_packages_cache_installed" ]]
  then
    unset _deb_packages_cache_installed
  fi

in _deb_packages_update_installed, the variable eventually gets
defined, and the bug still occurs. Perhaps this is due to the
cachevar=_deb_packages_cache_installed. But I don't know how the
function should end when the cache couldn't be filled up.

There's still the possibility to replace

  ${+_deb_packages_cache_installed} -eq 0

by

  -n "$+_deb_packages_cache_installed"

but this isn't the best solution.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



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