PKGFMT(1) User Commands PKGFMT(1)

pkgfmtformat a package manifest

pkgfmt [-c|-d|-s|-u] [-f v1|v2] [package-manifest-file]

pkgfmt without the -c or -d options formats a package manifest in a consistent manner, including wrapping lines at 80 characters, sorting lines by attributes. There are two different output formats - v1 and v2 - which have different sorting characteristics and are described below. The default output format is v2. Lines that do not parse into actions (such as macros, comments, or transforms) do not appear in sorted order.

If no arguments are given, pkgfmt reads stdin until EOF, and then writes the formatted manifest to stdout. Any manifests specified on the command line are formatted in place.

pkgfmt with the -c option checks whether the manifests are formatted in pkgfmt style. The -d option displays the differences if the file is not properly formatted.

pkgfmt with the -s option removes additional diagnostic attributes from actions that are not required in a published manifest.

pkgfmt supports two different output formats selectable with the -f option. The default format is v2.

The v1 format places set actions first, depend actions last and all other actions in between, sorted alphabetically. Actions are secondarily sorted by their primary attribute.
The v2 format groups actions together into different sections. The resulting action order is:

  1. actions
  2. all other actions, sorted by key attribute
  3. , group and user actions
  4. and license actions
  5. actions.

In particular, this format groups file, dir, link and hardlink actions together by path which can aid readability.

The following options are supported:

| |
Display a usage message.
Check whether the manifest is formatted in the pkgfmt style.
Display manifest differences from the formatted version in unified form.
v1|v2
Specify the desired output format.
Remove unecessary diagnostic attributes from manifest actions.
Do not wrap lines at 80 characters. This option is useful for applying traditional text processing tools to package manifests.

The following exit values are returned:

0
Command succeeded.
1
The -c or -d options were specified, and one or more manifests are not in pkgfmt normal form, or an error occurred.
2
Invalid command line options were specified.
99
An unanticipated exception occurred.

The following environment variable is supported:

The default output format, v1 or v2, overriding the built-in default value of v2.

The command line interface of pkgfmt is . The output of pkgfmt is and may change at any time.

pkg(7)

February 17, 2022 OmniOS