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
Tool Description Comments
portsnap Compares INDEX to .portsnap.INDEX for 'update' command Bug 1599461)
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)
Tool Description Comments
make index Generates INDEX
Tool Description Comments
portindex Perl INDEX generator WWW GitHub
makeindex TeX makeindex
  • 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.


1)
ColinPercival has explained that extra fields must be stripped for <9, maybe he can get patches in before release
2)
Only reads as far as it needs to
  • ports/index.txt
  • Last modified: 2022/05/13 03:55
  • by KubilayKocak