From owner-freebsd-ports@FreeBSD.ORG Fri Jan 16 19:33:32 2009 Return-Path: Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B94C1065670 for ; Fri, 16 Jan 2009 19:33:32 +0000 (UTC) (envelope-from bf2006a@yahoo.com) Received: from web39104.mail.mud.yahoo.com (web39104.mail.mud.yahoo.com [209.191.87.32]) by mx1.freebsd.org (Postfix) with SMTP id DB91E8FC17 for ; Fri, 16 Jan 2009 19:33:31 +0000 (UTC) (envelope-from bf2006a@yahoo.com) Received: (qmail 58134 invoked by uid 60001); 16 Jan 2009 19:33:31 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Message-ID; b=o/bgrkYKk/kK3gossiY+X5bWyPnhsQV7HeXcBM+rbSop1w29PXeIqn2HuY4UuT6hVwn2ge1o4FaSK6JpzbTM33+f8+BYN/1WK0ZAb0A2L/xre0a4qodSKvSfS/eQmSV3Lxx7Lwv0Pcb6bk8iLw1Ymlp/E0SOAREFsnnj2+FYRTE=; X-YMail-OSG: 4dlD8hIVM1nEmWuLTmBaoR8XG9qA3n75Pz8WGdCgXSKVTCCFQ2vaoEoEmuFiZFHCZWKYSeCj5HvuESPU8wIWCawVdM9bXvbhLZh8_ygcianxTPhgwF2toG.4aUecJxYSpvxx5aD8H0CE_h0ZHsKG0ArsngE- Received: from [217.114.211.20] by web39104.mail.mud.yahoo.com via HTTP; Fri, 16 Jan 2009 11:33:31 PST X-Mailer: YahooMailWebService/0.7.260.1 Date: Fri, 16 Jan 2009 11:33:31 -0800 (PST) From: bf To: freebsd-ports@FreeBSD.org, 000.fbsd@quip.cz MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <435622.58075.qm@web39104.mail.mud.yahoo.com> X-Mailman-Approved-At: Fri, 16 Jan 2009 19:46:00 +0000 Cc: Subject: direct vs. indirect port dependencies X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bf2006a@yahoo.com List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 19:33:32 -0000 Yes, I understood your question. I don't know of a pkg_info switch that will do what you want. Although my example was for perl, I was attempting to show you a more general approach to getting the information that you need. A moment's thought would show you that you could adapt my example, and use something like: #!/bin/sh PORTSDIR=${PORTSDIR:-/usr/ports} if [ "`pkg_info -E $1`" ] then dir1="`pkg_info -qo $1`" for pdir in `pkg_info -aoq` do pdepends="`make -C $PORTSDIR/$pdir -V RUN_DEPENDS -V LIB_DEPENDS`" ( echo "$pdepends" | grep -s -q -e "$dir1" ) && echo "$pdir" #or, if you prefer: #echo `make -C $PORTSDIR/$pdir -V PKGNAME` done else echo "$1 is not a valid package name" exit 1 fi done exit 0 Provided you have a ports tree in PORTSDIR, this would get you a list of all installed packages that have a specific package (the first argument $1 of the script, which must be named exactly, without a glob, in the example above) in their RUN_DEPENDS or LIB_DEPENDS, which I think is what you are looking for. Unlike pkg_info -r/-R and make-pretty-print run-depends-list, it is not recursive. As before, I make no claim that this is the best or the only way to do this. Regards, b.