Table of Contents

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 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)

Tools that use make describe

Tool Description Comments
make index Generates INDEX

Tools that generate INDEX

Tool Description Comments
portindex Perl INDEX generator WWW GitHub
makeindex TeX makeindex

Notes


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