Skip to content

sow dist

Create, list, inspect, and remove Dists, the RPM or DEB package sets that clients install from.

A Dist is the package set that clients see as one distribution, such as el9 or trixie. It is either RPM or DEB, has its own architecture views, policy (limit, exclude), and indexes under dists/, and shares the pool/ of its standard repository with the other Dists. sow dist creates, lists, inspects, and removes Dists. To change a Dist’s architectures or policy, edit sow.yml, then run sow config check and sow build.

Synopsis

sow dist ls [-C DIR] [-r NAME] [--json]
sow dist new NAME --format rpm|deb [-C DIR] [-r NAME] [-T DUR | -N] [--json] [--passfile PATH]
sow dist show NAME [-C DIR] [-r NAME] [--json]
sow dist rm NAME [-f|--force] [-C DIR] [-r NAME] [-T DUR | -N] [--json] [--passfile PATH]

dist new and dist rm accept --passfile for signing checks, signing, or recovery of an interrupted operation. dist ls and dist show do not read password files.

Examples

Create an RPM Dist and a DEB Dist in one repository:

sow dist new el9 --format rpm -r pgsql
sow dist new trixie --format deb -r pgsql

Create a beta Dist, set its package-retention policy in sow.yml, then rebuild it:

sow dist new el9-beta --format rpm -r pgsql
$EDITOR sow.yml          # el9-beta: { limit: 0 }
sow config check
sow build -r pgsql -d el9-beta

List Dists that need a build:

sow dist ls -r pgsql --json | jq -r '.result.dists[] | select(.dirty) | .name'

Naming

Dist names follow the repository rule: [a-z0-9][a-z0-9._-]*, excluding ., .., .sow, pool, and dists. Choose names that identify your distributions or channels, such as el9, trixie, or el9-beta; SOW infers neither format nor policy from the name.

sow dist ls

Lists the selected repository’s Dists. Read-only.

sow dist ls -r pigsty
NAME	FORMAT	ARCHITECTURES	DESIRED	BUILT	GENERATION	DIRTY	DIRTY_REASONS
el9	rpm	x86_64,aarch64	0	0	1	false	[]
trixie	deb	x86_64,aarch64	0	0	2	false	[]

DESIRED and BUILT count memberships. When the desired state has moved ahead of the last build, DIRTY_REASONS says why:

sow dist ls -r demo
NAME	FORMAT	ARCHITECTURES	DESIRED	BUILT	GENERATION	DIRTY	DIRTY_REASONS
el9	rpm	x86_64,aarch64	2	1	4	true	["Desired and Built membership sets differ"]

Pending repository maintenance can also make a Dist dirty while the counts match, so read dirty_reasons and sow status before treating a Dist as ready to deliver.

Flag Description Default
-C, --workdir DIR Workspace discovery start directory current directory
-r, --repo NAME Select a repository selection rules
--json Output JSON false

The table shows architecture families; JSON adds each package ecosystem’s own name. This architectures field from one entry in result.dists belongs to a DEB Dist, whose view directories are binary-amd64 and binary-arm64:

{
  "architectures": [
    {"family": "x86_64", "ecosystem_arch": "amd64"},
    {"family": "aarch64", "ecosystem_arch": "arm64"}
  ]
}

sow dist new

Creates a Dist with --format rpm or --format deb:

sow dist new el9 --format rpm -r pigsty
created el9: format=rpm architectures=x86_64,aarch64 members=0/0 generation=1 dirty=false
sow dist new trixie --format deb -r pigsty
created trixie: format=deb architectures=x86_64,aarch64 members=0/0 generation=2 dirty=false
Flag Description Default
--format FORMAT Required; rpm or deb —
-C, --workdir DIR Workspace discovery start directory current directory
-r, --repo NAME Select a repository selection rules
-T, --timeout DUR Maximum lock wait; 0 waits indefinitely 0
-N, --no-wait Fail immediately when the lock is held false
--passfile PATH Password file for this invocation per-key config, then SOW_GPG_PASSFILE
--json Output JSON false

A new Dist inherits the workspace architectures. To use a subset, or to set limit and exclude, edit sow.yml, then run sow config check and sow build.

Running dist new again with the same name and format prints the current state. The same name with a different format is rejected:

sow dist new el9 --format deb -r alpha
operation rejected: managed: operation rejected: dist "el9" already exists with format rpm

--format is required and accepts only rpm or deb:

sow dist new x -r alpha
usage error: dist new requires --format rpm|deb

sow dist new x --format zip -r alpha
usage error: --format must be rpm or deb

Creation and recovery

dist new updates sow.yml and builds the new Dist in one operation, so the Dist has valid empty indexes from the start: an empty repodata/ in each RPM architecture view, or empty Packages and Packages.gz, by-hash/SHA256/ entries, and a Release file for DEB, plus InRelease and Release.gpg when signing is configured. If the command is interrupted, run sow build to recover the operation.

sow dist show

Shows one Dist in detail. Read-only.

sow dist show trixielim -r pgsql
dist trixielim:
  format: deb
  architectures: x86_64,aarch64
  desired_members: 3
  built_members: 3
  generation: 6
  status: clean
  dirty: false
  dirty_reasons: []
Flag Description Default
-C, --workdir DIR Workspace discovery start directory current directory
-r, --repo NAME Select a repository selection rules
--json Output JSON false

JSON adds effective_config_sha256, a digest of the resolved Dist configuration. Changing limit, exclude, or a signing key changes the digest, and SOW marks the Dist dirty until you rebuild it.

sow dist show el9 -r pgsql --json
{"schema":"sow.cli/v1","command":"dist show","ok":true,"repository":"pgsql","operation":null,"result":{"name":"el9","format":"rpm","architectures":[{"family":"x86_64","ecosystem_arch":"x86_64"},{"family":"aarch64","ecosystem_arch":"aarch64"}],"desired_members":0,"built_members":0,"generation":"00000000000000000001","dirty":false,"status":"clean","effective_config_sha256":"a0b3ae2f943bc4fce951aaadda0fc8fb146ccf7944b0193a0dcc2b86ddc7ce7e","config":{"format":"rpm","architectures":["x86_64","aarch64"],"limit":1,"exclude":[{"kind":["debuginfo","debugsource"]}]}},"errors":[]}
sow dist show nope -r demo
operation rejected: managed: operation rejected: dist "nope" does not exist

sow dist rm

Removes a Dist’s configuration, membership, and indexes. A Dist that still has members needs -f:

sow dist rm el9 -r pgsql
operation rejected: managed: operation rejected: dist "el9" is not empty; use --force

sow dist rm el9 -r pgsql -f
removed dist el9 from pgsql
Flag Description Default
-f, --force Remove membership and indexes but retain pool packages false
-C, --workdir DIR Workspace discovery start directory current directory
-r, --repo NAME Select a repository selection rules
-T, --timeout DUR Maximum lock wait; 0 waits indefinitely 0
-N, --no-wait Fail immediately when the lock is held false
--passfile PATH Password file for this invocation per-key config, then SOW_GPG_PASSFILE
--json Output JSON false

If a configured target has published this Dist, the removal is rejected; see Removing a published view. A repository’s protected: true blocks only repository deletion, so dist rm works on protected repositories.

Dist removal does not delete Pool bytes

Other Dists and retained Generations may still use the same package files, so dist rm leaves pool/ alone:

sow dist rm el9 -r pgsql -f
removed dist el9 from pgsql

find pgsql -type f
pgsql/pool/e/epel-release/epel-release-7-5.noarch.rpm

Run sow gc to reclaim package files once no current or retained state needs them.

Exit codes

Code Trigger
0 Listed, created, shown or removed; or dist new reported an existing Dist
1 Runtime I/O or renderer error creating the empty indexes
2 Usage error — missing or invalid --format, workspace not found, ambiguous repository
4 Workspace or repository lock held and --no-wait given or --timeout expired
5 Integrity or recovery error in the operation journal
6 Invalid name, unknown Dist, format conflict with an existing name, non-empty without -f, or a Dist that a configured target has published

See also

Table reader