From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6881 invoked from network); 2 Jan 2003 17:19:46 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 2 Jan 2003 17:19:46 -0000 Received: (qmail 9367 invoked by alias); 2 Jan 2003 17:19:23 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18049 Received: (qmail 9348 invoked from network); 2 Jan 2003 17:19:23 -0000 X-VirusChecked: Checked X-Env-Sender: kiddleo@logica.com X-Msg-Ref: server-16.tower-4.messagelabs.com!1041527936!27783 X-Authentication-Warning: iris.logica.co.uk: Host [158.234.142.11] claimed to be finches.logica.co.uk In-reply-to: <20030102153706.GA7459@gulag.guild.uwa.edu.au> From: Oliver Kiddle References: <20030102140412.GG2863@gulag.guild.uwa.edu.au> <2419.1041518512@finches.logica.co.uk> <20030102153706.GA7459@gulag.guild.uwa.edu.au> To: James Devenish cc: zsh-workers@sunsite.dk Subject: Re: Refactoring _bsd_pkg Date: Thu, 02 Jan 2003 18:21:22 +0100 Message-ID: <3190.1041528082@finches.logica.co.uk> Sender: kiddleo@logica.com On 2 Jan, James Devenish wrote: > Yes, that's fine, I have attached a diff for the beast, only improving Thanks > pkd_delete, and pkg_info. I also replaced tabs with spaces since the > file seemed to have a mixture, and that's made the patch a bit large. > This is just a heads-up and I don't really intent on anyone feeling > willing to commit this verbatim -- it's night-time here and I'll have I've had a cursory glance through it and it all looks fine to me. Can $(arch -s) be safely replaced by $MACHTYPE? When you've got it to a point you're happy with, let me know and it can then be committed. > another look at it tomorrow. (And the person with the CC of my post is > the OpenBSD port maintainer for zsh, so he may have something useful to > add.) Except I got a delivery failure for him so he may not see the whole conversation. > pkg_add still doesn't work quite right because it always has some > directories (those matching the pattern /*) in the completion list, > even if my current directory is not /. This is in _bsd_pkg_pkgfiles() right? This bit looks suspicious: paths=( "${(@)${(@s.:.)PKG_PATH}:#}" ) _files "$@" -g '*.t[bg]z' && ret=0 (( $#path )) && _files "$@" -W paths -g '*.t[bg]z' && ret=0 compadd "$@" - $pkgsdir/*.t[bg]z && ret=0 The paths= line results in $paths containing a single empty element if PKG_PATH is not set. Does PKG_PATH have a default value? And shouldn't (( $#path )) && be (( $#paths )) && Can you do the whole thing as one _files line, something like this: paths=( . $pkgsdir ${(s.:.)PKG_PATH} ) _files "$@" -W paths -g '*.t[bg]z' > PS. I replaced '\'' with '', but maybe that's not portable? Also, I That depends on the rcquotes option. You can only depend on those options listed in $_comp_options (of which rcquotes is not one). I tend to stick the whole line in double quotes to make it more readable. Oliver This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.