Date: Tue, 27 Apr 2004 18:53:13 -0400 From: Randy Pratt <rpratt1950@earthlink.net> To: Jim Trigg <jtrigg@spamcop.net> Cc: freebsd-ports@freebsd.org Subject: Re: Tracing build dependencies Message-ID: <20040427185313.497d0dcd.rpratt1950@earthlink.net> In-Reply-To: <20040427205351.GC24672@spamcop.net> References: <20040427201910.GB24672@spamcop.net> <200404271343.02140.kstewart@owt.com> <20040427205351.GC24672@spamcop.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 27 Apr 2004 16:53:51 -0400 Jim Trigg <jtrigg@spamcop.net> wrote: > On Tue, Apr 27, 2004 at 01:43:02PM -0700, Kent Stewart wrote: > > On Tuesday 27 April 2004 01:19 pm, Jim Trigg wrote: > > > I remember seeing come across one of the FreeBSD lists (either ports, > > > stable, or questions) a shell script to show build dependencies of > > > installed ports (for use in determining whether installed ports are > > > orphans or not), but cannot now find it (either in my saved mail, in > > > the list archives, or through a web search). Does anyone have such a > > > script? > > > > Look at pkg_cutleaves. There are a number of others in ../sysutils. I > > followed the thread and installed it and pkg_tree. > > Unfortunately, it only looks in the pkgdb, which does not track build > dependencies (only RUN_DEPENDS and LIB_DEPENDS). I think you might be referring to a script I quickly wrote one day to use with pkg_cutleaves to find only build dependencies: http://docs.freebsd.org/cgi/mid.cgi?20040426103553.46157212.rpratt1950 It was a situation where I did not want to remove build dependencies because it was a slow box and did not want to have to rebuild them if not necessary during the next portupgrade. I rewrote that script after thinking about it a bit. It had the drawbacks of having to have another database file and requiring it to be manually updated if you wanted it to reflect the current status of installed ports. If all you need to know is that something depends on a port, then this might do what you want. It uses ports/INDEX as its source which includes both build and run dependencies. No extra databases are needed but it makes no distinction whether its a build or run dependency. You will need to supply the full package name, ie: bld_run_dep.sh rpm-3.0.6_9 ---begin script--- #!/bin/sh #Find Build/Run Dependencies for a Port (Uses ports/INDEX) database="/usr/ports/INDEX" pkg_exist=`pkg_info | awk '{print $1}'` list=`grep $1 $database | awk -F "|" '{print $1}'` for i in $list; do if [ $i != $1 ]; then for j in $pkg_exist; do if [ $j = $i ]; then echo "$i" fi done fi done ---end script--- Note that the script will filter out references to the port that you are checking for dependencies. HTH, Randy --
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040427185313.497d0dcd.rpratt1950>