Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 08 May 2005 20:54:58 -0600
From:      "James E. Flemer" <jflemer@uvm.edu>
To:        freebsd-ports@freebsd.org
Cc:        Michael Nottebrock <lofi@freebsd.org>
Subject:   Re: Why are implicit package dependencies recorded?
Message-ID:  <427ED102.6040406@uvm.edu>
In-Reply-To: <200505082049.31145.lofi@freebsd.org>
References:  <427E4687.40901@uvm.edu> <200505082044.52084.lofi@freebsd.org> <200505082049.31145.lofi@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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--



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