Subject: pkg/35266: 'make search key=' is broken
To: None <,,>
From: None <>
List: pkgsrc-bugs
Date: 12/17/2006 10:20:00
>Number:         35266
>Category:       pkg
>Synopsis:       'make search key=<keyword>' is broken
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 17 10:20:00 +0000 2006
>Release:        NetBSD 3.1.0_PATCH
Best regards, Aleksey Cheusov.
System: NetBSD 3.1.0_PATCH NetBSD 3.1.0_PATCH (GENERIC) #4: Sun Nov 5 01:36:02 EET 2006 i386
Architecture: i386
Machine: i386
make search key=<keyword>
functionality (described in pkgsrc.txt) is completely broken,
i.e. each time you type this command
from pkgsrc root directory INDEX file is always rebuilt,
and this takes looooong time. This is because
   rm ./PKGDB
rules in Makefile

make search key=word
make search key=word
The following patch fixes the problem.
If you want to force INDEX file rebuilding, IMHO it makes sense to
implement new target 'reindex'.

Index: Makefile
RCS file: /cvsroot/pkgsrc/Makefile,v
retrieving revision 1.77
diff -u -r1.77 Makefile
--- Makefile	2 Jul 2006 12:29:22 -0000	1.77
+++ Makefile	17 Dec 2006 10:15:12 -0000
@@ -100,7 +100,6 @@
 .include "${.CURDIR}/mk/bulk/"
 	@${RM} -f ${.CURDIR}/PKGDB
 	@${ECHO_MSG} "Extracting complete dependency database.  This may take a while..."
@@ -143,7 +142,6 @@
 	@${RM} -f ${.CURDIR}/INDEX
 	@${AWK} -f ./mk/scripts/genindex.awk PKGSRCDIR=${.CURDIR} SORT=${SORT} ${.CURDIR}/PKGDB
-	@${RM} -f ${.CURDIR}/PKGDB
 print-index: ${.CURDIR}/INDEX
 	@${AWK} -F\| '{ printf("Pkg:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\nArch:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10); }' < ${.CURDIR}/INDEX