From linimon@lonesome.com  Mon Apr 21 11:22:00 2003
Return-Path: <linimon@lonesome.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E98DC37B401
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Apr 2003 11:22:00 -0700 (PDT)
Received: from mail.soaustin.net (mail.soaustin.net [207.200.4.66])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6879743FE1
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Apr 2003 11:22:00 -0700 (PDT)
	(envelope-from linimon@lonesome.com)
Received: from lonesome.lonesome.com (cs242746-11.austin.rr.com [24.27.46.11])
	(using TLSv1 with cipher RC4-MD5 (128/128 bits))
	(No client certificate requested)
	by mail.soaustin.net (Postfix) with ESMTP
	id 4CDD11435E; Mon, 21 Apr 2003 13:21:56 -0500 (CDT)
Message-Id: <200304211325.03667.linimon@lonesome.com>
Date: Mon, 21 Apr 2003 13:25:03 -0500
From: Mark Linimon <linimon@lonesome.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc: roman@bellavista.cz
Subject: Re: Problem Report ports/40699: allow exclude patterns in `make search`

>Number:         51242
>Category:       ports
>Synopsis:       Re: Problem Report ports/40699: allow exclude patterns in `make search`
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ceri
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 21 11:30:08 PDT 2003
>Closed-Date:    Wed Apr 30 15:11:42 PDT 2003
>Last-Modified:  Wed Apr 30 15:11:42 PDT 2003
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 Kris, see if this is this patch will do what you want:
 
 --- bsd.port.subdir.mk.dist	Mon Apr 21 12:58:52 2003
 +++ bsd.port.subdir.mk	Mon Apr 21 13:20:39 2003
 @@ -37,6 +37,10 @@
  #	search:
  #		Search for ports using either 'make search key=<keyword>'
  #		or 'make search name=<keyword>'.
 +#		You can exclude ports with 'excl=<keyword>', i. e.
 +#		'make search name=<keyword> excl=<keyword>' or
 +#		'make search key=<keyword> excl=<keyword>'.
 +
  
  
  .MAIN: all
 @@ -272,9 +276,17 @@
  	top=`pwd -P`; \
  	there=`echo "$$here/" | sed s%$$top%${PORTSDIR}%`; \
  	if [ -n "$$key" ]; then \
 -	  grep $$there ${PORTSDIR}/${INDEXFILE} | 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); }'; \
 +	  if [ -n "$$excl" ]; then \
 +	    grep $$there ${PORTSDIR}/${INDEXFILE} | grep -i "${key}" | grep -v 
 "${excl}" | 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); }'; \
 +	  else \
 +	    grep $$there ${PORTSDIR}/${INDEXFILE} | 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); }'; \
 +	  fi; \
  	elif [ $$name ]; then \
 -	  grep $$there ${PORTSDIR}/${INDEXFILE} | grep -i "^[^|]*${name}[^|]*|" | 
 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); }'; \
 +	  if [ -n "$$excl" ]; then \
 +	    grep $$there ${PORTSDIR}/${INDEXFILE} | grep -i "^[^|]*${name}[^|]*|" | 
 grep -v "${excl}" | 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); }'; \
 +	  else \
 +	    grep $$there ${PORTSDIR}/${INDEXFILE} | grep -i "^[^|]*${name}[^|]*|" | 
 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); }'; \
 +	   fi; \
  	else \
  	  echo "The search target requires a keyword parameter or name parameter,"; 
 \
  	  echo "e.g.: \"make search key=somekeyword\""; \
 
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ceri 
State-Changed-When: Wed Apr 30 15:11:12 PDT 2003 
State-Changed-Why:  
Misfiled follow up to ports/40699 [content migrated]. 


Responsible-Changed-From-To: gnats-admin->ceri 
Responsible-Changed-By: ceri 
Responsible-Changed-When: Wed Apr 30 15:11:12 PDT 2003 
Responsible-Changed-Why:  
Take from gnats-admin. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=51242 
>Unformatted:
