Subject: pkg/34207: /usr/pkgsrc/Makefile -- "make index" deletes INDEX's dependency PKGDB
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <djv@bedford.net>
List: pkgsrc-bugs
Date: 08/15/2006 22:35:00
>Number:         34207
>Category:       pkg
>Synopsis:       /usr/pkgsrc/Makefile  -- "make index" deletes INDEX's dependency PKGDB
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 15 22:35:00 +0000 2006
>Originator:     David Vanecek
>Release:        3.0.1
>Organization:
>Environment:
NetBSD jezebel.chuck 3.0.1 NetBSD 3.0.1 (GENERIC) #0: Thu Jul 13 23:43:47 UTC 2006  builds@b3.netbsd.org:/home/builds/ab/netbsd-3-0-1-RELEASE/i386/200607131826Z-obj/home/builds/ab/netbsd-3-0-1-RELEASE/src/sys/arch/i386/compile/GENERIC i386
>Description:
The subject Makefile contains a line causing the removal of PKGDB whenever INDEX is made.  When "make search key=something" is then executed, INDEX is out of date, since its predecessor is removed.  Then the tedious (many, many hour) process of making PKGDB from scratch is executed, recreating INDEX.  Then, paradoxically, PKGDB is removed.  "make search ..." repeats the process ad nauseam.  The solution should be not to remove PKGDB after making it (and INDEX) at such high cost.  The offending lines in the Makefile are these:

${.CURDIR}/INDEX: ${.CURDIR}/PKGDB
        @${RM} -f ${.CURDIR}/INDEX
        @${AWK} -f ./mk/scripts/genindex.awk PKGSRCDIR=${.CURDIR} SORT=${SORT} $
{.CURDIR}/PKGDB
        @${RM} -f ${.CURDIR}/PKGDB

Deleting the last line might cure the problem; I believe it is the bug.

An alternative solution is to remove dependencies on INDEX.

The pkgsrc was extracted from the 2006Q2 release, obtained a day or two ago.

Dave

>How-To-Repeat:
cd /usr/pkgsrc ; make INDEX; make search key=wget 
>Fix:
Delete indicated line.  I have not tried this; I do not yet know what the PKGDB file is *for*.  (I am an OpenBSD user, mostly, so am not intimately acquainted with the NetBSD pkg tools.)