From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14427 invoked from network); 24 Jun 2006 19:26:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Jun 2006 19:26:30 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 36253 invoked from network); 24 Jun 2006 19:26:23 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Jun 2006 19:26:23 -0000 Received: (qmail 8990 invoked by alias); 24 Jun 2006 19:26:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22511 Received: (qmail 8981 invoked from network); 24 Jun 2006 19:26:20 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 24 Jun 2006 19:26:20 -0000 Received: (qmail 36018 invoked from network); 24 Jun 2006 19:26:20 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 24 Jun 2006 19:26:19 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id C242670E2F; Sat, 24 Jun 2006 15:26:16 -0400 (EDT) Date: Sat, 24 Jun 2006 15:26:16 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: _tar (autodetection of compression by GNU tar >= 1.14.91) Message-ID: <20060624192616.GA1430@scowler.net> Mail-Followup-To: zsh-workers@sunsite.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.11+cvs20060403 Since version 1.14.91, GNU tar has autodetected compressed archives. Index: Completion/Unix/Command/_tar =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_tar,v retrieving revision 1.3 diff -u -r1.3 _tar --- Completion/Unix/Command/_tar 27 Feb 2003 09:29:26 -0000 1.3 +++ Completion/Unix/Command/_tar 24 Jun 2006 19:24:54 -0000 @@ -21,6 +21,8 @@ # from some of the possible long options, and from the second word if # that does not start with a hyphen. +_pick_variant gnu=GNU unix --version + tmp=("${(@M)words:#-[^-]*}") _tar_cmd="${(j::)tmp#-}" Index: Completion/Unix/Type/_tar_archive =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_tar_archive,v retrieving revision 1.3 diff -u -r1.3 _tar_archive --- Completion/Unix/Type/_tar_archive 21 Jan 2004 13:53:29 -0000 1.3 +++ Completion/Unix/Type/_tar_archive 24 Jun 2006 19:24:54 -0000 @@ -18,6 +18,8 @@ _files "$expl[@]" -g '*.((tar|TAR).(gz|GZ|Z)|tgz)(-.)' elif [[ "$1" = *[Ijy]* ]]; then _files "$expl[@]" -g '*.(tar|TAR).bz2(-.)' + elif [[ "$_cmd_variant[$service]" == gnu ]]; then + _files "$expl[@]" -g '*.((tar|TAR).(gz|GZ|Z|bz2)|tgz)(-.)' else _files "$expl[@]" -g '*.(tar|TAR)(-.)' fi