Skip to content

sow changes

List the files that differ between two Generations, in the order a safe update applies them.

sow changes lists the files that differ between two Generations, grouped by phase in the order a safe update applies them: packages, then metadata, then entry points, then deletions. Use it to review what a build changed before you publish, to drive your own sync script, or with base 0 to get a complete delivery manifest. It reads built state only, so run sow build first if pending changes should be included. To deliver the result to a configured target, use sow publish, which applies the same phases for you.

Synopsis

sow changes [BASE_GENERATION] [-C|--workdir DIR] [-r|--repo NAME] [--json]
Flag Meaning Default
-C, --workdir DIR Workspace discovery start directory current directory
-r, --repo NAME Select a repository selection rules
--json Output JSON false

BASE_GENERATION defaults to the predecessor of the current Generation; see Base Generation. The plan always covers the whole repository, so -d/--dist is rejected.

Before it lists anything, changes runs the full sow check verification on every Dist of the repository, using all CPUs (there is no -j). It costs as much as a check, since it hashes every package file again, and it exits 5 instead of printing a plan when any verification layer fails. Unbuilt desired changes do not count as a failure; see Dirty and recovery states.

Output

sow changes
base=4 generation=5 dirty=false
add	payload	pool/c/centos-release/centos-release-6-0.el6.centos.5.x86_64.rpm	19776	ffd9e7bd...
add	metadata	dists/el9/x86_64/repodata/5bc463cb...-primary.xml.gz	1460	5bc463cb...
update	pointer	dists/el9/x86_64/repodata/repomd.xml	1514	05d3d5bf...
delete	delete	dists/el9/x86_64/repodata/0df96f0b...-primary.xml.gz	0	

The header names both Generations. Each following line has five tab-separated columns: operation, phase, path relative to the repository root, size, and SHA-256.

Field Values
operation add, update, delete
phase payload, metadata, pointer, delete

To deliver a plan without SOW’s publisher, copy the files phase by phase in that order, or stage a complete copy and switch it into service.

Base Generation

BASE_GENERATION is a decimal integer in 0..current, where current is the number of the current Generation.

  • Base 0 lists every file of the current Generation as an addition: the complete delivery manifest, excluding private sow.yml and .sow/.
  • Base equal to the current Generation gives an empty plan. A repository that was never built gives an empty 0 -> 0 plan.
  • A base outside the range is rejected:
sow changes 99
operation rejected: managed: operation rejected: base generation 99 is outside 0..2

Examples

Save a complete manifest of the current Generation:

sow changes 0 -r pgsql --json > pgsql-current.json

Show only the changes under one Dist:

sow changes -r pgsql --json |
  jq '.result.changes[] | select(.path | startswith("dists/el9/"))'

Details

Dirty and recovery states

When desired state has unbuilt changes, the header shows dirty=true, but the plan still ends at the current Generation. Pending payloads are private until a build moves them into the pool, so they never appear in the plan.

changes exits 5 when the repository is recovering or error, when an operation or workspace operation is unfinished, during a layout migration, or when the files on disk differ from the current Generation’s manifest. Recover or repair the repository as the diagnostic says, then rerun. A damaged public file, for example, stops it with the same error check reports:

sow changes
integrity or recovery error: managed: integrity or recovery failure: changes are unavailable because delivery integrity check failed: managed: integrity or recovery failure: public file /srv/sow/demo/dists/el9/x86_64/repodata/repomd.xml mode 0600 is not world-readable or is world-writable

A base inside the valid range whose manifest is no longer stored is rejected with exit 6.

Exit codes

Code Trigger
0 Plan printed, including an empty plan
1 Runtime I/O failure
2 Usage error, -d supplied, workspace not found, or implicit repository selection is ambiguous
5 A verification layer failed, the repository is recovering or error or has an unfinished operation, or state evidence is inconsistent
6 Explicit repository is not configured, or Base Generation is outside the valid range or no longer stored

See also

Table reader