pkg_patch produces patch files which are tarred and compressed (currently with bz2) archives containing metadata and data files.

Note: unless otherwise specified, "package name" means full package name, including its version (but excluding any path information and the archive suffix). For example, apache-2.2.13 is a package name. As the current port/package infrastructure does not explicitly separate the version information out from the package name, there is some small room for confusion while parsing.

pkg_patch introduces two files with the following common format:

pkg_patch metadata file format

Files are text files in UTF-8 encoding, with Unix ("\n") line endings. Lines have different meanings depending on how they start:

This format is used in the following files:


This files is embedded in the package patch files, along other metadata files taken from the "target" package. It describes the difference in content of two package files. It contains the following metadata items:

Note that the metadata file contains paths relative to the package archive contents, as do other similar metadata files within the packages, but the real filenames are derived from +CONTENTS files (using its "cwd" information).

A sample +PKGPATCH file is:

# FreeBSD package patch archive created on Mon Aug  9 02:59:08 2010

@version 1.0
@source libiconv-1.13.1
@target libiconv-1.13.1_1
@patch [method=cp] libdata/charset.alias
@patch [method=cp] lib/
@patch [method=ln] lib/
@patch [method=cp] lib/
@patch [method=cp] lib/libiconv.a
@patch [method=cp] lib/
@patch [method=ln] lib/
@patch [method=cp] lib/
@patch [method=cp] lib/libcharset.a
@patch [method=cp] bin/iconv

The result of applying the +PKGPATCH file to the source package archive contents is to transform it into the target package archive contents.


This file appears in the root of on-line (web-based) package patch repository and describes available patches in the repository.

It contains the following metadata items:

A sample PKGPATCHINDEX file is:

# Created by mkpatchdir at Mon Aug  9 02:58:21 2010

@version 1.0
@havepatch apache-2.2.13 apache-2.2.15_9 apache-2.2.13-2.2.15_9.tbz 2010-08-09T00:58:29Z
@havepatch expat-2.0.1 expat-2.0.1_1 expat-2.0.1-2.0.1_1.tbz 2010-08-09T00:58:29Z
@havepatch perl-5.8.9_3 perl-5.10.1_1 perl-5.8.9_3-5.10.1_1.tbz 2010-08-09T00:59:05Z
@havepatch pcre-7.9 pcre-8.02 pcre-7.9-8.02.tbz 2010-08-09T00:59:07Z
@havepatch libiconv-1.13.1 libiconv-1.13.1_1 libiconv-1.13.1-1.13.1_1.tbz 2010-08-09T00:59:09Z

The filenames are relative to the location of the PKGPATCHINDEX file.

IvanVoras/pkg_patch/FileFormats (last edited 2010-08-12T00:11:26+0000 by IvanVoras)