Ports INDEX File
Introduction
Index files contain port/package metadata, providing fast lookup of information by other tools. They are located in /usr/ports (${INDEXDIR}, by default), named INDEX-X (${INDEXFILE}), where X is the systems FreeBSD major version (Example: INDEX-13, INDEX-14)
An index file can either be generated with the make index command, or, a pre-built and compressed version downloaded with the make fetchindex command.
Each line of an index file is one entry keyed by PKGNAME, containing port metadata output by the make describe command.
As of 2022-05 make describe output contains:
distribution-name|port-path|installation-prefix|comment| description-file|maintainer|categories|extract-depends| patch-depends|fetch-depends|build-depends|run-depends|www site
Tools that read INDEX
Tool |
Description |
Comments |
portsnap |
Compares INDEX to .portsnap.INDEX for 'update' command |
|
make search |
Queries INDEX for attribute=value lookup |
|
pkg version |
Used by pkg version (pkg-version) and rquery (pkg-rquery) commands |
Appending new fields not a problem 2 |
Tools that use make describe
Tool |
Description |
Comments |
make index |
Generates INDEX |
|
Tools that generate INDEX
Notes
- This format has been set in stone due to certain tools that try to parse it for information, and until a complete list of these tools is found we can't do much about sanitising the format.
ColinPercival has explained that extra fields must be stripped for <9, maybe he can get patches in before release (1)
Only reads as far as it needs to (2)