querying the registry for installed files

Clemens Lang cal at macports.org
Fri Oct 28 12:22:41 PDT 2016

On Fri, Oct 28, 2016 at 08:41:58PM +0200, René J.V. Bertin wrote:
> I think the registry keeps track of all installed files, whether they
> belong to active or inactive ports, right?
> If so, is there a way to query the registry with a filename pattern,
> to obtain the full paths of known matching filesand the port(s) which
> provide them?

Isn't this essentially what 'port provides' does?

But yes, that's possible:
 sqlite> .load macports.sqlext
 sqlite> select
    , files.path
 from files
 join ports
 on files.id = ports.id
        files.active = 1
    and ports.name = 'apr'
    and files.path like '%/include/%';


More information about the macports-dev mailing list