From owner-freebsd-ports Thu Jul 29 13:26: 2 1999 Delivered-To: freebsd-ports@freebsd.org Received: from mail11.svr.pol.co.uk (mail11.svr.pol.co.uk [195.92.193.23]) by hub.freebsd.org (Postfix) with ESMTP id 8830614C1D for ; Thu, 29 Jul 1999 13:25:58 -0700 (PDT) (envelope-from tom@freebsd.org) Received: from modem-91.thalidomide.dialup.pol.co.uk ([62.136.88.219] ident=[vsIf2xu5UqyfA2V7dYhjjE5f9+9JpwX3]) by mail11.svr.pol.co.uk with esmtp (Exim 2.12 #1) id 119wkW-0005lM-00 for ports@freebsd.org; Thu, 29 Jul 1999 21:25:57 +0100 Received: (qmail 533 invoked by uid 5000); 29 Jul 1999 19:56:04 -0000 Date: Thu, 29 Jul 1999 20:56:04 +0100 From: Tom Hukins To: Tim Vanderhoek Cc: Nik Clayton , ports@freebsd.org Subject: Re: Move "search" from /usr/ports/Makefile to bsd.port.mk Message-ID: <19990729205604.A486@hukins.freeserve.co.uk> Mail-Followup-To: Tim Vanderhoek , Nik Clayton , ports@freebsd.org References: <19990727163124.A33168@kilt.nothing-going-on.org> <19990727172846.C37558@mad> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <19990727172846.C37558@mad>; from Tim Vanderhoek on Tue, Jul 27, 1999 at 05:28:46PM -0400 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Tue, Jul 27, 1999 at 05:28:46PM -0400, Tim Vanderhoek wrote: > > This more or less equates to rewriting the search target. Currently > search works by doing a simple grep through the ports/INDEX file. > Probably easy enough to make it grep for both a key and a category. > > To make it work in an arbitrary subdir would be different. The > INDEX is mostly constructed from the output of make describe. The > describe target will work in an arbitrary subdir. It wouldn't be > hard to do This type of thing can be done very easily with my FreeBSD::Ports::* Perl modules: my $ports = tie my %port, 'FreeBSD::Ports::Index', '/usr/ports/INDEX'; $ports->category('audio'); print $_->as_ascii foreach keys %port; > And that will work and give the desired effect (tested), but it will > be slow. Yes, parsing the INDEX file is slow. Version 0.02 of my modules will hopefully use Perl's Storable, or something similar, to dump out a parsed version of an INDEX file. Unfortunately, I've not had any time to work on these modules in ages, but I'm hoping to get more work done some time in August. Regards, Tom To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message