finding dependents of a shared library

Clemens Lang cal at macports.org
Wed May 24 18:45:24 UTC 2017


Hi,

On Wed, May 24, 2017 at 04:23:15PM +0200, René J.V. Bertin wrote:
> AFAIK the way rev-upgrade works is
> - rev-upgrade scans a list of all supposed-to-be-present binary files

Correct.

> - for each file on that list it determines the list of dependencies
>   (or list of deps provided by active ports)

The part outside of parentheses is correct, the part inside isn't.
rev-upgrade doesn't care whether the dep is provided by an active port,
it just makes sure the library is there and will load.


> It seems to me that we thus have the basic features available to write
> a SpotLight importer for MachO binary files which would enter this
> reverse dependency information in the SpotLight database. IOW,
> associate the dependent to each found dependency.

Yes, that could be done. The relevant code is in src/machista1.0, with
Tcl bindings and in C. I don't see a particular reason why we should
involve Spotlight there, especially considering Apple's tendency to
break APIs whenever they see fit and introduce a maintenance burden.
A SQLite database would do just fine.


> Does that sound like a feasible and useful idea (and one that won't
> overload SpotLight)? Or maybe someone already invented this wheel
> (wouldn't that be nice :))?

Most of this is done, really. You just need the file iteration, invoke
libmachista/machista1.0 APIs, run over the results and put them into
some database.

I'm not aware of a finished tool that does it.

-- 
Clemens


More information about the macports-dev mailing list