From owner-freebsd-questions@FreeBSD.ORG Tue Apr 14 19:02:15 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 903B1106566C for ; Tue, 14 Apr 2009 19:02:15 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 58ED68FC0A for ; Tue, 14 Apr 2009 19:02:14 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from sarevok.dnr.servegame.org (gate.lan.rachie.is-a-geek.net [192.168.2.10]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id B00597E818; Tue, 14 Apr 2009 11:02:13 -0800 (AKDT) From: Mel Flynn To: freebsd-questions@freebsd.org Date: Tue, 14 Apr 2009 21:02:08 +0200 User-Agent: KMail/1.11.0 (FreeBSD/8.0-CURRENT; KDE/4.2.0; i386; ; ) References: <49E274F5.4030001@onetel.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200904142102.09258.mel.flynn+fbsd.questions@mailing.thruhere.net> Cc: Tim Judd , Chris Whitehouse Subject: Re: make run-depends-list-recursive? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2009 19:02:15 -0000 On Monday 13 April 2009 03:56:15 Tim Judd wrote: > On Sun, Apr 12, 2009 at 5:10 PM, Chris Whitehouse wrote: > > Hi > > > > Is there a make target which will give a list of _all_ dependencies > > recursively not just next level up? Or a port? I tried > > ports-mgmt/pkg_tree but it only seems to work with installed ports. > > > > I don't care if I get duplicates as long as every dependency is listed at > > least once. > > > > Thanks > > > > Chris > > make all-depends-list Two things: 1) It surpresses config target and if a port has OPTIONS set, then you may get surprised once you've configured the port and ticked/unticked an option 2) It includes EXTRACT_DEPENDS, PATCH_DEPENDS and BUILD_DEPENDS, which typically don't end up in run dependencies. Looking at the subject this may not be what you need. make -C /usr/ports/category/portname -V LIB_DEPENDS -V RUN_DEPENDS will list the dependencies that will be registered in /var/db/pkg. Recurse through the list, take the second field split by : and run the above for each origin. Something like the script below, which calls the config target if not configured, remembers already visited dependencies and then prints the runtime dependency list. -- Mel #!/bin/sh VISITED= if test $# -eq 0; then startdir=`pwd` else startdir=$1 fi config_port() { local ldeps rdeps curdir curdir=$1 make -C ${curdir} config-conditional ldeps=`make -C ${curdir} -V LIB_DEPENDS` rdeps=`make -C ${curdir} -V RUN_DEPENDS` for dep in ${ldeps} ${rdeps}; do dir=${dep#*:} # For 3-part deps where 3rd field is target, ex: # dovecot:${PORTSDIR}/mail/dovecot:build dir=${dir%%:*} case ${VISITED} in *" ${dir} "*|*" ${dir}") ;; *) VISITED="${VISITED} ${dir}" config_port ${dir} esac done } config_port $startdir for dir in ${VISITED}; do echo $dir done