direct vs. indirect port dependencies

bf bf2006a at yahoo.com
Fri Jan 16 11:33:32 PST 2009


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.



      


More information about the freebsd-ports mailing list