Subject: pkg/13111: speed up patch for make index
To: None <gnats-bugs@gnats.netbsd.org>
From: None <si006@ccm.gs.niigata-u.ac.jp>
List: netbsd-bugs
Date: 06/05/2001 10:30:14
>Number:         13111
>Category:       pkg
>Synopsis:       spped up the make index process
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 04 18:29:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Shun SUZUKI
>Release:        NetBSD-current obtained at 2001/05/30
>Organization:
Shun SUZUKI <si006@ccm.gs.niigata-u.ac.jp>
Graduate School of Science and Technology Niigata University
>Environment:
	<machine, os, target, libraries (multiple lines)>
System: NetBSD jormungand 1.5V NetBSD 1.5V (JORMUNGAND) #8: Mon Jun 4 10:48:02 JST 2001 root@jormungand:/home11/home10/src/sys/arch/i386/compile/JORMUNGAND i386
Architecture: i386
Machine: i386
>Description:
This patch sppedes up the make index process of pkgsrc by caching
the build and run depends-list.
There is no way to make index without caching.
There is no way to update the caches,
you should clean up these cache files manually.
>How-To-Repeat:
>Fix:
--- mk/bsd.pkg.mk.orig	Wed May 30 06:00:34 2001
+++ mk/bsd.pkg.mk	Tue Jun  5 07:59:54 2001
@@ -2357,7 +2357,8 @@
 		else							\
 			${ECHO_MSG} "${_PKGSRC_IN}> ${WRKDIR} not writable, skipping"; \
 		fi;							\
-	fi
+	fi;								\
+	${RM} -f .build-depends-cache .run-depends-cache
 .ifdef WRKOBJDIR
 	-${_PKG_SILENT}${_PKG_DEBUG}					\
 	${RMDIR} ${BUILD_DIR} 2>/dev/null;				\
@@ -2708,7 +2709,13 @@
 # Will probably not work with PACKAGE_DEPENDS_WITH_PATTERNS=false ...
 PACKAGE_DEPENDS_QUICK?=false
 .if !target(run-depends-list)
-run-depends-list:
+run-depends-list: .run-depends-cache
+	@${CAT} .run-depends-cache
+
+.run-depends-cache:
+	@${MAKE} run-depends-list2 > .run-depends-cache
+
+run-depends-list2:
 .for dep in ${DEPENDS}
 	@pkg="${dep:C/:.*//}";						\
 	dir="${dep:C/[^:]*://}";					\
@@ -2822,7 +2829,13 @@
 .endif
 
 .if !target(build-depends-list)
-build-depends-list:
+build-depends-list: .build-depends-cache
+	@${CAT} .build-depends-cache
+
+.build-depends-cache:
+	@${MAKE} build-depends-list2 > .build-depends-cache
+
+build-depends-list2:
 .for dir in ${BUILD_DEPENDS} ${DEPENDS}
 	${_PKG_SILENT}${_PKG_DEBUG}					\
 	cd ${dir:C/^[^:]*://:C/:.*//};					\
>Release-Note:
>Audit-Trail:
>Unformatted: