ports/146829: [PATCH]: bsd.port.mk: change "missing" target to run pkg_info only once

Yuri Pankov yuri.pankov at gmail.com
Sat May 22 13:40:04 UTC 2010


>Number:         146829
>Category:       ports
>Synopsis:       [PATCH]: bsd.port.mk: change "missing" target to run pkg_info only once
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 22 13:40:03 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Yuri Pankov
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
System: FreeBSD darklight.org.ru 9.0-CURRENT FreeBSD 9.0-CURRENT #2 r208414M: Sat May 22 13:53:45 MSD 2010
>Description:
Change "missing" target to run pkg_info only once and cache the result. Running `pkg_info -O <origin>` for every dependency can be very time and I/O consuming when we have a large number of installed ports.
>How-To-Repeat:
>Fix:
--- bpm.diff begins here ---
Index: ports/Mk/bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.638
diff -u -r1.638 bsd.port.mk
--- ports/Mk/bsd.port.mk	12 May 2010 19:57:57 -0000	1.638
+++ ports/Mk/bsd.port.mk	22 May 2010 13:16:32 -0000
@@ -5524,11 +5524,11 @@
 
 # Show missing dependiencies
 missing:
-	@for dir in $$(${ALL-DEPENDS-LIST}); do \
-		THISORIGIN=$${dir##${PORTSDIR}/}; \
-		installed=$$(${PKG_INFO} -qO $${THISORIGIN}); \
-		if [ -z "$$installed" ]; then \
-			${ECHO_CMD} $$THISORIGIN; \
+	@_origins=$$(${PKG_INFO} -aoq); \
+	for dir in $$(${ALL-DEPENDS-LIST}); do \
+		_origin=$${dir##${PORTSDIR}/}; \
+		if ! $$(${ECHO_CMD} $${_origins} | ${GREP} -q $${_origin}); then \
+			${ECHO_CMD} $${_origin}; \
 		fi; \
 	done
 
--- bpm.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list