Skip to content

sow ls

List the packages Dists should contain, with exact references and where each one is built.

sow ls lists the packages in the selected Dists’ desired membership and shows, for each one, which Dists want it and which already contain it in the current Generation. Use it to copy exact references for show or rm, or to spot packages that are waiting for a build. To find a package anywhere in the workspace, use sow where.

Synopsis

sow ls [-C|--workdir DIR] [-r|--repo NAME] [-d|--dist NAME]... [--json]
Flag Meaning Default
-C, --workdir DIR Workspace discovery start directory current directory
-r, --repo NAME Select a repository selection rules
-d, --dist NAME Select a Dist; repeatable selection rules
--json Output JSON false

Output

sow ls -r pigsty -d el9
repository=pigsty dists=el9 dirty=false
SHA256	COORDINATE	DISTS	BUILT_DISTS	POOL_PATH
sha256:d6f332ed157de1d42058ec785b392a1cc4b5836c27830af8fbf083cce29ef0ab	rpm:epel-release-0:7-5.noarch	el9	el9	pool/e/epel-release/epel-release-7-5.noarch.rpm

The first line says whether the selected Dists are dirty; a configuration change can make them dirty even when membership is unchanged. Each package then appears once:

Column Meaning
SHA256 Immutable content identity; valid input to show and rm
COORDINATE Canonical rpm: or deb: package reference
DISTS Desired membership across the repository
BUILT_DISTS Membership present in the current Generation
POOL_PATH Immutable package path, relative to the repository

-d chooses which packages are listed, by desired membership; the DISTS and BUILT_DISTS columns then show every place in the repository that package appears, comma-separated. An empty BUILT_DISTS means no Dist includes the package in its current build yet. A package removed with rm --skip is already gone from this list, even while the last built index still contains it. An empty Dist succeeds with no package rows. With --json, the rows are in result.packages.

Examples

List exact references for all objects not yet built:

sow ls -r pgsql -d el9 --json |
  jq -r '.result.packages[] | select(.built_dists | length == 0) | "sha256:" + .sha256'

List pool paths in deterministic order:

sow ls -r pgsql -d el9 --json | jq -r '.result.packages[].pool_path' | sort

Selection

ls needs a definite set of Dists. In a repository with several Dists, pass one or more -d values or run it from inside <repo>/dists/<dist>/:

sow ls -r pigsty
workspace discovery error: managed: workspace discovery error: repository "pigsty" has multiple Dists (el9, trixie); select one or more with --dist

Exit codes

Code Trigger
0 Membership printed, including an empty list
1 Runtime I/O failure
2 Usage error, workspace not found, or implicit repository/Dist selection is ambiguous
5 Repository state database unreadable or inconsistent
6 Explicit repository or Dist is not configured

See also

Table reader