From owner-freebsd-ports Sun May 5 18:27:10 2002 Delivered-To: freebsd-ports@freebsd.org Received: from sdns.kv.ukrtel.net (sdns.kv.ukrtel.net [195.5.27.246]) by hub.freebsd.org (Postfix) with ESMTP id DAD6237B401; Sun, 5 May 2002 18:27:00 -0700 (PDT) Received: from vega.vega.com (195.5.51.243 [195.5.51.243]) by sdns.kv.ukrtel.net with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id J9KHZCSQ; Mon, 6 May 2002 04:28:41 +0300 Received: (from max@localhost) by vega.vega.com (8.11.6/8.11.3) id g461RJX21648; Mon, 6 May 2002 04:27:19 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) From: Maxim Sobolev Message-Id: <200205060127.g461RJX21648@vega.vega.com> Subject: Re: [RFC] Improving dependency registration procedure for ports To: sobomax@FreeBSD.ORG (Maxim Sobolev) Date: Mon, 6 May 2002 04:27:09 +0300 (EEST) Cc: kris@obsecurity.org (Kris Kennaway), sobomax@FreeBSD.ORG (Maxim Sobolev), ports@FreeBSD.ORG In-Reply-To: from "Maxim Sobolev" at May 06, 2002 12:09:25 AM X-Mailer: ELM [version 2.5 PL5] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="%--multipart-mixed-boundary-1.21631.1020648429--%" Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --%--multipart-mixed-boundary-1.21631.1020648429--% Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > > On Sun, May 05, 2002 at 04:48:45PM +0300, Maxim Sobolev wrote: > > > > > Attached patch should resolve this problem by registering real > > > dependencies using bar's origin as a key for looking up name of > > > package installed from the bar port. > > > > Yes, this is needed. Thanks for doing this work! > > > > > Another feature embodied into this patch is the ability to designate > > > "replacement" ports for bar using ALT_ORIGINS variable. Imagine > > > situation when you have bar and bar-devel port, both of which have > > > the same functionality, but the latter being a bleeding-edge > > > version of the former. In this case port maintainer could set > > > "ALT_ORIGINS=somecat/bar-devel" in somecat/bar/Makefile and make > > > all ports that could use either bar or bar-devel depending on bar. > > > Then, during package-registration process bsd.port.mk will see > > > which one is really installed and generate list of dependencies > > > accordingly. This should be very useful for things like XFree86. > > > > I'll have to think some more about this. I'm not sure how much use it > > will actually be. > > > > I'll take a closer look at the patch later. > > Ok, attached is extended version of that patch, which adds support > for generating packages with DEPORIGIN: feature, as described in > my pkg_create(8) commit message. > > Any feedback is greatly appreciated. OOPS, sorry, previous version broke package registration by not updatign +REQUIRED_BY files during installation of the package. Attached patch should cope with it correctly. As an extra bonus you will get another 2x speedup of package registration process (I donno how I missed this one when I was looking at a ways to speed-up bsd.port.mk). -Maxim --%--multipart-mixed-boundary-1.21631.1020648429--% Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Description: ASCII text Content-Disposition: attachment; filename="bsd.port.mk.diff" Index: bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.411 diff -d -u -r1.411 bsd.port.mk --- bsd.port.mk 27 Apr 2002 11:22:59 -0000 1.411 +++ bsd.port.mk 6 May 2002 01:21:10 -0000 @@ -3151,9 +3157,20 @@ package-depends-list: @${PACKAGE-DEPENDS-LIST} -PACKAGE-DEPENDS-LIST= \ +PACKAGE-DEPENDS-LIST?= \ if [ "${CHILD_DEPENDS}" ]; then \ - ${ECHO_CMD} "${PKGNAME} ${.CURDIR}"; \ + for origin in ${PKGORIGIN} ${ALT_ORIGINS}; do \ + installed=$$(${PKG_INFO} -qO $$origin); \ + if [ "$$installed" ]; then \ + break; \ + fi; \ + done; \ + if [ -z "$$installed" ]; then \ + installed="${PKGNAME}"; \ + fi; \ + for pkgname in $$installed; do \ + ${ECHO_CMD} "$$pkgname ${.CURDIR} ${PKGORIGIN}"; \ + done; \ fi; \ checked="${PARENT_CHECKED}"; \ for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//') $$(${ECHO_CMD} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//'); do \ @@ -3161,12 +3178,11 @@ if (${ECHO_CMD} $$checked | ${GREP} -qwv "$$dir"); then \ childout=$$(cd $$dir; ${MAKE} CHILD_DEPENDS=yes PARENT_CHECKED="$$checked" package-depends-list); \ set -- $$childout; \ - childname=""; childdir=""; \ + childdir=""; \ while [ $$\# != 0 ]; do \ - childname="$$childname $$1"; \ childdir="$$childdir $$2"; \ - ${ECHO_CMD} "$$1 $$2"; \ - shift 2; \ + ${ECHO_CMD} "$$1 $$2 $$3"; \ + shift 3; \ done; \ checked="$$dir $$childdir $$checked"; \ fi; \ @@ -3178,7 +3194,7 @@ # Print out package names. package-depends: - @${PACKAGE-DEPENDS-LIST} | ${AWK} '{print $$1}' + @${PACKAGE-DEPENDS-LIST} | ${AWK} '{print $$1":"$$3}' ################################################################ # Everything after here are internal targets and really @@ -3413,8 +3429,8 @@ if [ -f ${PKGMESSAGE} ]; then \ ${CP} ${PKGMESSAGE} ${PKG_DBDIR}/${PKGNAME}/+DISPLAY; \ fi; \ - for dep in `cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} package-depends ECHO_MSG=${TRUE} | sort -u`; do \ - if [ -d ${PKG_DBDIR}/$$dep -a -z `echo $$dep | ${GREP} -E ${PKG_IGNORE_DEPENDS}` ]; then \ + for dep in `${PKG_INFO} -qf ${PKGNAME} | ${GREP} -w ^@pkgdep | ${AWK} '{print $$2}' | sort -u`; do \ + if [ -d ${PKG_DBDIR}/$$dep -a -z `${ECHO_CMD} $$dep | ${GREP} -E ${PKG_IGNORE_DEPENDS}` ]; then \ if ! ${GREP} ^${PKGNAME}$$ ${PKG_DBDIR}/$$dep/+REQUIRED_BY \ >/dev/null 2>&1; then \ ${ECHO_CMD} ${PKGNAME} >> ${PKG_DBDIR}/$$dep/+REQUIRED_BY; \ --%--multipart-mixed-boundary-1.21631.1020648429--%-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message