Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jun 2007 12:02:05 +0200
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        pav@freebsd.org
Cc:        ports@freebsd.org, portmgr@freebsd.org
Subject:   The committed package speedup is a little bit flawed
Message-ID:  <20070617120205.798f933d@deskjail>

next in thread | raw e-mail | index | archive | help
--MP_iFhNvAf96RVYidA8HDGU2Hx
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

somehow you didn't got the final patch. Attached is the fastest version
we where able to come up with. Additionally it contains a safety net
("-gt" part) in case there's something wrong (no ORIGIN in +CONTENTS).
With the current version you run into an error, with the patch you
don't.

It also contains the possibility to only record explicit package
dependencies instead of all implicit dependencies too (you have to set
EXPLICIT_PACKAGE_DEPENDS to some value to change the current default
behavior). This allows to experiment with explicit package
dependencies. If you don't like this part, just remove the
  -a -z "${EXPLICIT_PACKAGE_DEPENDS}"

On a related note, have you got a PR for the "make clean"-speedup?


Interested parties can find "inofficial" (as in "not in GNATS for
portmgr testing") patches for this and some more bsd.port.mk
improvements for testing at:
    http://www.Leidinger.net/FreeBSD/port-patches/

Bye,
Alexander.

-- 
"man hier" will explain the way FreeBSD filesystems are normally laid out.
		-- David Scheidt <dscheidt@tumbolia.com>
http://www.Leidinger.net  Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org     netchild @ FreeBSD.org  : PGP ID = 72077137

--MP_iFhNvAf96RVYidA8HDGU2Hx
Content-Type: text/x-patch; name=bsd.port.mk.diff
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=bsd.port.mk.diff

Index: Mk/bsd.port.mk
===================================================================
RCS file: /import/FreeBSD-CVS/ports/Mk/bsd.port.mk,v
retrieving revision 1.569
diff -u -r1.569 bsd.port.mk
--- Mk/bsd.port.mk	16 Jun 2007 19:07:42 -0000	1.569
+++ Mk/bsd.port.mk	17 Jun 2007 09:49:52 -0000
@@ -5380,23 +5533,20 @@
 
 ACTUAL-PACKAGE-DEPENDS?= \
 	if [ "${_LIB_RUN_DEPENDS}" != "  " ]; then \
-		for pkgname in ${PKG_DBDIR}/*; do \
+		origins=$$(for pkgname in ${PKG_DBDIR}/*; do \
 			if [ -e $$pkgname/+CONTENTS ]; then \
-				a=$${pkgname\#\#*/}; \
-				b=`${SED} -n -e "s/@comment ORIGIN://p" $$pkgname/+CONTENTS`; \
-				if [ ! -z $$b ]; then \
-					origins="$$origins $$a $$b"; \
-				fi; \
+				${ECHO_CMD} $${pkgname\#\#*/}; \
+				${SED} -n -e "s/@comment ORIGIN://p" $$pkgname/+CONTENTS; \
 			fi; \
-		done; \
+		done); \
 		for dir in ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}; do \
 			tmp=$${dir%/*}; \
 			dir=$${tmp\#\#*/}/$${dir\#\#*/}; \
 			set -- $$origins; \
-			while [ $$\# != 0 ]; do \
-				if [ $$dir = $$2 ]; then \
+			while [ $$\# -gt 1 ]; do \
+				if [ "$$dir" = "$$2" ]; then \
 					${ECHO_CMD} $$1:$$dir; \
-					if [ -e ${PKG_DBDIR}/$$1/+CONTENTS ]; then \
+					if [ -e ${PKG_DBDIR}/$$1/+CONTENTS -a -z "${EXPLICIT_PACKAGE_DEPENDS}" ]; then \
 						packagelist="$$packagelist ${PKG_DBDIR}/$$1/+CONTENTS"; \
 					fi; \
 					break; \

--MP_iFhNvAf96RVYidA8HDGU2Hx--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070617120205.798f933d>