checking a file's dependents/cies?

Rainer Müller raimue at macports.org
Tue Aug 30 04:01:28 PDT 2016


On 2016-08-30 12:33, René J.V. Bertin wrote:
> Is there a direct way to check what (binary) files depend on a given file belonging to a port, something a bit less blunt than moving the file aside and running `port -v rev-upgrade`?
> I presume a mysql query of the registry could return that kind of information - just as it could return the file's own registered dependencies?

No, that information is not stored in the registry. The registry only
stores dependencies between ports, not files.

rev-upgrade iterates over all binaries in the prefix and checks if
referenced libraries are still available and if they have a compatible
version.

You can recreate that with the subset of relevant files to get the
information you want, you can get the list of files in recursive
dependents of the port providing the library you are interested in
and then check if they link against this library.

For example for liblzma provided by the xz port:

lib=/opt/local/lib/liblzma.dylib
port -q contents rdependentof:$(port -q provides $lib |awk '{print $5}') \
  | grep /bin/ \
  | while read bin; do
      otool -L $bin | grep -q liblzma && echo $bin
  done

Hope this helps,
Rainer


More information about the macports-dev mailing list