* Re: Refactoring _bsd_pkg [not found] ` <20030102153706.GA7459@gulag.guild.uwa.edu.au> @ 2003-01-02 17:21 ` Oliver Kiddle 2003-01-02 17:34 ` James Devenish 0 siblings, 1 reply; 2+ messages in thread From: Oliver Kiddle @ 2003-01-02 17:21 UTC (permalink / raw) To: James Devenish; +Cc: zsh-workers 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. ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Refactoring _bsd_pkg 2003-01-02 17:21 ` Refactoring _bsd_pkg Oliver Kiddle @ 2003-01-02 17:34 ` James Devenish 0 siblings, 0 replies; 2+ messages in thread From: James Devenish @ 2003-01-02 17:34 UTC (permalink / raw) To: Oliver Kiddle; +Cc: zsh-workers In message <3190.1041528082@finches.logica.co.uk> on Thu, Jan 02, 2003 at 06:21:22PM +0100, Oliver Kiddle wrote: > > 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. Re: David Lebel, I got no delivery errors and am corresponding with his at the present minute. This is interesting, as according inference from the mail Date headers, there are 13 hours of time difference between us. In message <3190.1041528082@finches.logica.co.uk> on Thu, Jan 02, 2003 at 06:21:22PM +0100, Oliver Kiddle wrote: > I've had a cursory glance through it and it all looks fine to me. Can > $(arch -s) be safely replaced by $MACHTYPE? I will check with him, as he has more OpenBSD experience than I. > When you've got it to a point you're happy with, let me know and it can > then be committed. Thanks, I will repost my suggestions tomorrow (with the guiding advice you have about the paths). > > 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? Mmm. > This bit looks suspicious: > > paths=( "${(@)${(@s.:.)PKG_PATH}:#}" ) [...etc...] I was not clear on the exact mode of operation of that portion, but I will continue to try to arrive at a possible equivalent that makes sense with respect to OpenBSD behaviour (may have to introduce another case clause). > > 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. Good plan. I will modify my patch to do that, then. As I only stumbled across _bsd_pkg today, it seems to me to have a few oddities/ non-neatnesses that may be "legacy" matters (if you know what I mean). Thanks. ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-01-02 17:34 UTC | newest] Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20030102140412.GG2863@gulag.guild.uwa.edu.au> [not found] ` <2419.1041518512@finches.logica.co.uk> [not found] ` <20030102153706.GA7459@gulag.guild.uwa.edu.au> 2003-01-02 17:21 ` Refactoring _bsd_pkg Oliver Kiddle 2003-01-02 17:34 ` James Devenish
Code repositories for project(s) associated with this public inbox https://git.vuxu.org/mirror/zsh/ This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).