Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jul 1999 17:28:46 -0400
From:      Tim Vanderhoek <vanderh@ecf.utoronto.ca>
To:        Nik Clayton <nik@nothing-going-on.demon.co.uk>
Cc:        ports@freebsd.org
Subject:   Re: Move "search" from /usr/ports/Makefile to bsd.port.mk
Message-ID:  <19990727172846.C37558@mad>
In-Reply-To: <19990727163124.A33168@kilt.nothing-going-on.org>; from Nik Clayton on Tue, Jul 27, 1999 at 04:31:24PM %2B0100
References:  <19990727163124.A33168@kilt.nothing-going-on.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jul 27, 1999 at 04:31:24PM +0100, Nik Clayton wrote:
> 
> 	Agreed.  Along similar lines I'd *love* to see the search target of
> 	/usr/ports/Makefile moved into bsd.port.mk in such a way so that one
> 	could change to a subdirectory such as /usr/ports/print and run a
> 	`make search' for just that part of the tree.

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

cd /usr/ports/subdir ; make describe | grep -i "${key}" | awk -F\| '{
printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\n\n",
$1, $2, $4, $6, $7, $8, $9); }'

And that will work and give the desired effect (tested), but it will
be slow.

There isn't any ACCEPTABLE way to do it "right".

Cheating by grepping INDEX first for the category and then for the key
is easy enough.

Adding this to each subdirectory Makefile will work.  I suggest this
solution rather than a bsd.port.mk solution, although changed to
look more nicer and more sexier.

PORTSDIR?=      /usr/ports

search: ${PORTSDIR}/INDEX
	@grep ${.CURDIR} ${PORTSDIR}/INDEX | grep -i "${key}" | awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps
:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9); }'

[Also tested].

You may want to file my message with the bugreport.


-- 
This is my .signature which gets appended to the end of my messages.


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?19990727172846.C37558>