Quoting Stephen Montgomery-Smith <[EMAIL PROTECTED]> (Thu, 17 May 2007 08:14:43 
-0500):

> Alexander Leidinger wrote:
> > Quoting Alexander Leidinger <[EMAIL PROTECTED]> (Thu, 17 May 2007 11:44:36 
> > +0200):
> > 
> >> For the difference between the redirected output case: I think the
> >> gnome terminal needs a lot of time to print all the lines. But still,
> >> the awk version takes around 3/4 of the time (interesting is the user
> >> time, not the total time). Stephen's version can be speed up some
> >> fractions by inserting a break into the first while-loop.
> >>
> >> Attached is my awk-version and the awk version which also includes the
> >> direct dependencies.
> > 
> > After a little review: For the awk version the embedded "sort -u" can
> > be removed (it is done in the PKG_ARGS part), for Stephen's version it
> > is necessary to cut down processing time in the following part.
> 
> Agreed

I played around a little bit with this, new version attached (simple
error handling in awk, doing just one awk for all files).

Comments please.

Stephen, if I don't get problem reports I will send-pr this as you
suggested.

Bye,
Alexander.

-- 
STANDARDS:
        The principles we use to reject other people's code.
http://www.Leidinger.net  Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org     netchild @ FreeBSD.org  : PGP ID = 72077137
--- /usr/ports/Mk/bsd.port.mk	Sat Apr  7 14:51:47 2007
+++ /space/jails/basejail/usr/ports/Mk/bsd.port.mk	Thu May 17 17:46:25 2007
@@ -2321,7 +2321,7 @@
 DISABLE_CONFLICTS=	YES
 .endif
 .if !defined(PKG_ARGS)
-PKG_ARGS=		-v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${MAKE} package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u`" ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS}
+PKG_ARGS=		-v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${MAKE} actual-package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u`" ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS}
 .if !defined(NO_MTREE)
 PKG_ARGS+=		-m ${MTREE_FILE}
 .endif
@@ -5145,15 +5145,43 @@
 				shift 3; \
 			done; \
 			checked="$$dir $$childdir $$checked"; \
-		else \\
+		else \
 			${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
 		fi; \
 	done
 
+ACTUAL-PACKAGE-DEPENDS?= \
+	if [ "${_LIB_RUN_DEPENDS}" != "  " ]; then \
+		origins=$$(for pkgname in ${PKG_DBDIR}/*; do \
+			if [ -e $$pkgname/+CONTENTS ]; then \
+				basename $$pkgname; \
+				${SED} -n -e "s/@comment ORIGIN://p" $$pkgname/+CONTENTS; \
+			fi; \
+		done); \
+		for dir in ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}; do \
+			dir=`dirname $$dir | xargs basename`/`basename $$dir`; \
+			set -- $$origins; \
+			while [ $$\# != 0 ]; do \
+				if [ $$dir = $$2 ]; then \
+					${ECHO_CMD} $$1:$$dir; \
+					if [ -e ${PKG_DBDIR}/$$1/+CONTENTS ]; then \
+						packagelist="$$packagelist ${PKG_DBDIR}/$$1/+CONTENTS"; \
+					fi; \
+					break; \
+				fi; \
+				shift 2; \
+			done; \
+		done; \
+		[ -z "$$packagelist" ] || ${AWK} -F '( |:)' 'BEGIN { pkgname="broken_contents" } /@pkgdep / { pkgname=$$2 } /@comment DEPORIGIN:/ { printf "%s:%s\n", pkgname, $$3; pkgname="broken_contents" }' $$packagelist; \
+	fi
+
 # Print out package names.
 
 package-depends:
 	@${PACKAGE-DEPENDS-LIST} | ${AWK} '{print $$1":"$$3}'
+
+actual-package-depends:
+	@${ACTUAL-PACKAGE-DEPENDS}
 
 # Build packages for port and dependencies
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to