Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jan 2009 11:33:31 -0800 (PST)
From:      bf <bf2006a@yahoo.com>
To:        freebsd-ports@FreeBSD.org, 000.fbsd@quip.cz
Subject:   direct vs. indirect port dependencies  
Message-ID:  <435622.58075.qm@web39104.mail.mud.yahoo.com>

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



      



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