Date: Wed, 07 Feb 2001 18:17:03 +0200 From: Maxim Sobolev <sobomax@FreeBSD.org> To: Peter Pentchev <roam@orbitel.bg> Cc: Jordan Hubbard <jkh@winston.osd.bsdi.com>, ports@FreeBSD.org, jkh@FreeBSD.org, Edwin Groothuis <mavetju@chello.nl> Subject: Re: Request for comments [Fwd: bin/24695: [patch] pkg_info: prefix search for a package] Message-ID: <3A8174FF.C79215AA@FreeBSD.org> References: <10197.981450491@winston.osd.bsdi.com> <3A7FC36A.1434D2CC@FreeBSD.org> <3A801D32.DE73F780@FreeBSD.org> <20010206180825.A406@ringworld.oblivion.bg>
next in thread | previous in thread | raw e-mail | index | archive | help
Peter Pentchev wrote: > On Tue, Feb 06, 2001 at 05:50:10PM +0200, Maxim Sobolev wrote: > > Maxim Sobolev wrote: > > > > > Jordan Hubbard wrote: > > > > > > > > but was away from e-mail) ;). What do you think if I reimplement 'fuzzy' and > > > > > 'prefix' options from original proposal into `glob' and `regex' options? So > > > > > regex kidz would be able say "-x .*foo.*", while glob-lovers "-g *foo*". > > > > > > > > I love it. You could even make -g "implicit", e.g. I don't see any > > > > reason why "pkg_info emacs*" shouldn't just work, right? The only > > > > time you really need to pass a flag is to indicate a particular type > > > > of globbing, e.g. regex. > > > > > > Agreed. I already have globbing in place, so expect patches soon ;). > > > > Here it is. With this patch pkg_install treats any arguments as shell globs by > > default and as regexs with -x, so for example the following is equivalent: > > $ pkg_info foo\* > > $ pkg_info -x ^foo.\* > > > > Please let me know what do you think about those patches. > > > > -Maxim > > The patches look great! I'll test them in an hour or two.. Any further comments? > Just a minor comment: in the rexs_match() function, you compile > each pattern time and again, for each package. Not that it would > matter a lot (the actual performance bottleneck would be disk I/O, > I suppose), but it could fasten things a bit if you precompiled > all patterns into a regex_t array at the start. Yes, I'm considering it, but have not decided finally yet (code bloat vs. performance). -Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A8174FF.C79215AA>