Date: Wed, 16 May 2007 16:01:56 -0500 From: Stephen Montgomery-Smith <stephen@math.missouri.edu> To: "[LoN]Kamikaze" <LoN_Kamikaze@gmx.de> Cc: Pav Lucistnik <pav@freebsd.org>, freebsd-ports@freebsd.org, Kris Kennaway <kris@obsecurity.org> Subject: Re: Time to abandon recursive pulling of dependencies? Message-ID: <464B7144.2000600@math.missouri.edu> In-Reply-To: <464B155A.1080105@math.missouri.edu> References: <464597C6.3030406@gmx.de> <20070512174011.GA22526@xor.obsecurity.org> <4645FF71.60100@gmx.de> <20070512175824.GA23103@xor.obsecurity.org> <20070512133054.B5588@math.missouri.edu> <4646193E.5040503@gmx.de> <464665D5.1090509@math.missouri.edu> <464676CC.2000203@math.missouri.edu> <46469BF5.9030603@math.missouri.edu> <1179058696.13237.3.camel@ikaros.oook.cz> <20070513101332.L82202@math.missouri.edu> <46479215.1080401@math.missouri.edu> <4647C4FB.9050607@math.missouri.edu> <4647F182.6000402@gmx.de> <46487491.6020806@math.missouri.edu> <46488168.3030300@math.missouri.edu> <464B155A.1080105@math.missouri.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Ok chaps, I think I have it.
This involves no recursive calls of make. Furthermore the dependencies
it creates are the real dependencies on your system, not what ports
thinks it should be, because it gets all the information from
/var/db/pkg. On my system it takes a second or two to register a port -
it takes about the same amount of time whether it has few dependencies
or many, except when there are zero dependencies, when it takes no time
at all.
If I get some positive feedback on this one, I'll submit a PR. You can
try it out by typing "make actual-package-depends" as opposed to "make
package-depends."
Stephen
[-- Attachment #2 --]
--- bsd.port.mk-orig Mon May 14 09:28:42 2007
+++ bsd.port.mk Wed May 16 15:51:44 2007
@@ -2387,7 +2387,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
@@ -5216,10 +5216,46 @@
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); \
+ pkgs=$$(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; \
+ if [ -e ${PKG_DBDIR}/$$1/+CONTENTS ]; then \
+ ${SED} -n -e "s/@pkgdep //p" ${PKG_DBDIR}/$$1/+CONTENTS; \
+ fi; \
+ fi; \
+ shift 2; \
+ done; \
+ done | sort -u); \
+ for pkgname in $$pkgs; do \
+ set -- $$origins; \
+ while [ $$\# != 0 ]; do \
+ if [ $$pkgname = $$1 ]; then \
+ ${ECHO_CMD} $$1:$$2; \
+ break; \
+ fi; \
+ shift 2; \
+ done; \
+ done; \
+ 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?464B7144.2000600>
