From owner-freebsd-questions@FreeBSD.ORG Thu Dec 14 18:53:33 2006 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED94216A4AB for ; Thu, 14 Dec 2006 18:53:33 +0000 (UTC) (envelope-from bsd-unix@earthlink.net) Received: from pop-gadwall.atl.sa.earthlink.net (pop-gadwall.atl.sa.earthlink.net [207.69.195.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id E5AAE43F63 for ; Thu, 14 Dec 2006 18:46:50 +0000 (GMT) (envelope-from bsd-unix@earthlink.net) Received: from fl-71-54-28-212.dhcp.embarqhsd.net ([71.54.28.212] helo=kt.weeeble.com) by pop-gadwall.atl.sa.earthlink.net with smtp (Exim 3.36 #1) id 1Guvd0-0002Wu-00; Thu, 14 Dec 2006 13:48:23 -0500 Date: Thu, 14 Dec 2006 13:48:22 -0500 From: Randy Pratt To: Frank Staals Message-Id: <20061214134822.a15e8808.bsd-unix@earthlink.net> In-Reply-To: <45819393.20700@gmx.net> References: <45819393.20700@gmx.net> X-Mailer: Sylpheed version 2.2.10 (GTK+ 2.10.6; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: questions@FreeBSD.org Subject: Re: Getting a list of dependencies which have to be installed ? 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: Thu, 14 Dec 2006 18:53:34 -0000 On Thu, 14 Dec 2006 19:10:27 +0100 Frank Staals wrote: > Hey..., > > Is there a utility to display the dependencies of a port which have yet > to be installed ? I know you can get a complete dependency list on > freebsd.org/ports , pkg_info -r or just looking in the files in the > ports dir. But is there a command to display only the dependencies which > haven't been installed on your system yet ? I also looked at pkg_add -n > but it immediately starts fetching the packages needed. I don't want to > start downloading the complete package just because I want a list of > ports I haven't installed yet. > > Or is the only way making a diff between the pkg_info -r output and your > pkg_info -a ? If so : Is there a way to tell pkg_info when using the -r > flag on a not-yet-installed-port to only get a list of the dependencies > instead of downloading the complete package ? Or is there just an other > utility which can display this information which I'm not aware of ? I don't know of a utility that does that function. Like you, I often want to know what I'm committing to when installing a new port so I wrote a small script to do just that: what_do_i_need.sh ================================================================= #!/bin/sh #List needed ports not already installed portsdir="`make -V PORTSDIR`" pkgdbdir="`make -V PKG_DBDIR`" indexfile="`make -V INDEXFILE`" origin_list="`pwd` `make all-depends-list`" for origin in ${origin_list}; do # echo "ORIGIN: ${origin}" pkg_name="`grep "|${origin}|" ${portsdir}/${indexfile} \ | cut -d "|" -f 1`" padding=$(( 50 - `echo "${origin}" | wc -c` +1)) if [ ! -e "${pkgdbdir}/${pkg_name}" ]; then printf " NEED: ${origin}%${padding}c${pkg_name}\n" " " fi done ================================================================= Put it in your path somewhere, chmod to executable and use like: # cd xawtv # what_do_i_need.sh NEED: /usr/ports/multimedia/xawtv xawtv-3.95_1 NEED: /usr/ports/x11-fonts/tv-fonts tv-fonts-1.1 It will only list the needed ports butyou can modify it to do as you want. Its probably a wise idea to make sure all ports have been updated to match your ports tree. HTH, Randy --