From owner-freebsd-ports@FreeBSD.ORG Mon May 9 02:55:03 2005 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9DB8A16A4E6; Mon, 9 May 2005 02:55:03 +0000 (GMT) Received: from pony.uvm.edu (pony.uvm.edu [132.198.101.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0027F43D53; Mon, 9 May 2005 02:55:02 +0000 (GMT) (envelope-from jflemer@uvm.edu) Received: from [192.168.2.15] (c-24-9-89-237.hsd1.co.comcast.net [24.9.89.237]) (authenticated bits=0) by pony.uvm.edu (8.12.11/8.12.11) with ESMTP id j492sx2X014462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 May 2005 22:55:01 -0400 Message-ID: <427ED102.6040406@uvm.edu> Date: Sun, 08 May 2005 20:54:58 -0600 From: "James E. Flemer" User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050504) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-ports@freebsd.org References: <427E4687.40901@uvm.edu> <200505082044.52084.lofi@freebsd.org> <200505082049.31145.lofi@freebsd.org> In-Reply-To: <200505082049.31145.lofi@freebsd.org> Content-Type: multipart/mixed; boundary="------------050605030609090400050402" cc: Michael Nottebrock Subject: Re: Why are implicit package dependencies recorded? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 02:55:03 -0000 This is a multi-part message in MIME format. --------------050605030609090400050402 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Michael Nottebrock wrote: > On Sunday, 8. May 2005 20:44, Michael Nottebrock wrote: > > >>>Both of these cases can be avoided by building P with the same flags >>>that D was built with. In the simple case, that does not seem like a >>>bad solution, but in practice there can be a huge number of deps and >>>sub-deps (mplayer has around 45). > > > Ah, I've been reading too fast again. Yes, all packages in a dependency-chain > will have to be built to match. It would be possible to make the pkg_* tools > smarter in order to avoid that, but at the moment quite everything (from > pkg_* to the package cluster scripts) relies on prerecorded (or > pre-generated, i.e. INDEX) sub-deps. > Actually, pkg_add does indeed do the right thing when only first-order dependencies are recorded in the package. I was pretty sure that was the case, so I cooked up a trivial case and the (implicit) sub-dep was installed correctly. The interesting thing is that of the many *-depends and *-depends lists targets in bsd.port.mk, only one needs changing to change the packaging behavior. The PACKAGE-DEPENDS-LIST macro is used for the package-depends-list and package-depends targets, and the latter is what determines the pkgdep lines in the package. Neither of these two targets are used for any other purpose in the Mk/bsd.*.mk files. A simple three line patch[1] is all that is needed to make the change to record only the first-order dependencies. The all-depends-list target and macro are left recursive, preserving all other recursive aspects of the port infrastructure. I cannot say what external consumers there are of the PACKAGE-DEPENDS-LIST macro, or of the package-depends and package-depends-list targets. However, there are no consumers other than do-package within the port makefile infrastructure. [1] Hopefully attached and at: http://www.cs.rpi.edu/~flemej/freebsd/pkg-first-order-deps/ -James --------------050605030609090400050402 Content-Type: text/plain; name="bsd.port.mk.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bsd.port.mk.diff" --- bsd.port.mk.orig Sun May 8 20:18:18 2005 +++ bsd.port.mk Sun May 8 20:42:20 2005 @@ -608,7 +608,7 @@ # for this port. # package-depends-list # - Show all directories which are -# package-dependencies for this port. +# first-order dependencies for this port. # run-depends-list # - Show all directories which are run-dependencies # for this port. @@ -4522,7 +4522,7 @@ fi; \ done | ${SORT} -u -# Package (recursive runtime) dependency list. Print out both directory names +# Package first-order dependency list. Print out both directory names # and package names. package-depends-list: @@ -4543,7 +4543,7 @@ for pkgname in $$installed; do \ ${ECHO_CMD} "$$pkgname ${.CURDIR} ${PKGORIGIN}"; \ done; \ - fi; \ + else \ checked="${PARENT_CHECKED}"; \ for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \ dir=$$(${REALPATH} $$dir); \ @@ -4562,7 +4562,8 @@ else \ ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \ fi; \ - done + done; \ + fi # Print out package names. --------------050605030609090400050402--