From owner-freebsd-ports Wed Feb 7 8:19:31 2001 Delivered-To: freebsd-ports@freebsd.org Received: from blizzard.sabbo.net (blizzard.sabbo.net [193.193.218.18]) by hub.freebsd.org (Postfix) with ESMTP id 2E37837B401; Wed, 7 Feb 2001 08:19:00 -0800 (PST) Received: from vic.sabbo.net (root@vic.sabbo.net [193.193.218.112]) by blizzard.sabbo.net (8.10.1/8.10.1) with ESMTP id f17GH6g02123; Wed, 7 Feb 2001 18:17:13 +0200 Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vic.sabbo.net (8.11.2/8.11.2) with ESMTP id f17GH9m04295; Wed, 7 Feb 2001 18:17:09 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Message-ID: <3A8174FF.C79215AA@FreeBSD.org> Date: Wed, 07 Feb 2001 18:17:03 +0200 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.76 [en] (WinNT; U) X-Accept-Language: uk,ru,en MIME-Version: 1.0 To: Peter Pentchev Cc: Jordan Hubbard , ports@FreeBSD.org, jkh@FreeBSD.org, Edwin Groothuis Subject: Re: Request for comments [Fwd: bin/24695: [patch] pkg_info: prefix search for a package] References: <10197.981450491@winston.osd.bsdi.com> <3A7FC36A.1434D2CC@FreeBSD.org> <3A801D32.DE73F780@FreeBSD.org> <20010206180825.A406@ringworld.oblivion.bg> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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