From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22899 invoked by alias); 21 Jan 2015 17:37:02 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34335 Received: (qmail 20418 invoked from network); 21 Jan 2015 17:37:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Biglobe-Sender: From: "Jun T." Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: PATCH: _yum: fix typos in cache-handling code Message-Id: <7C32A369-D9F2-4862-B73E-D1595AB5DF2B@kba.biglobe.ne.jp> Date: Thu, 22 Jan 2015 01:49:50 +0900 To: zsh-workers@zsh.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) X-Biglobe-Spnum: 51254 The following patch will fix bugs (or typos) in function _yum_all_pkgs(). The second hank is to complete package names for $ yum info all (Q1) the indentation in _yum is in disorder: spaces; tab(s); or even tab after spaces; should they be "fixed"? (Q2) possibly very long, and time consuming, list of package names is offered by a bare compadd. Should it be wrapped in _wanted ? Jun diff --git a/Completion/Redhat/Command/_yum b/Completion/Redhat/Command/_yum index ae63364..a698328 100644 --- a/Completion/Redhat/Command/_yum +++ b/Completion/Redhat/Command/_yum @@ -85,15 +85,14 @@ _yum() fi } -# Fills the installed pkg cache +# Fills the all pkg cache _yum_all_pkgs() { if ( [[ ${+_all_pkgs} -eq 0 ]] || _cache_invalid ALL ) && ! _retrieve_cache ALL; then - local prog="yum -C list all | sed 's/\s.*//' | grep '\.'" - _all_pkgs=( $(kages $prog 2>/dev/null) ) - _store_cache ALL _all_pkg + _all_pkgs=( $(yum -C list all | sed 's/\s.*//' | grep '\.' 2>/dev/null) ) + _store_cache ALL _all_pkgs fi } @@ -227,8 +226,9 @@ _yum_list_or_info() else local subcmd subcmd="${${listlist[(r)$words[2]:*]%%:*}}" - # Deal with any aliases + # offer packages selected by the subcommand case $subcmd in + all) _yum_all;; installed) _yum_erase;; available) _yum_install;; updates) _yum_update;;